diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index 78ee9fd51c..84c15a4574 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -339,7 +339,7 @@ ULONG WINAPI RtlIsDosDeviceName_U( PCWSTR dos_name ) } end = dos_name + strlenW(dos_name) - 1; - if (end >= dos_name && *end == ':') end--; /* remove trailing ':' */ + while (end >= dos_name && *end == ':') end--; /* remove all trailing ':' */ /* find start of file name */ for (start = end; start >= dos_name; start--) diff --git a/dlls/ntdll/tests/path.c b/dlls/ntdll/tests/path.c index 14af1cfe3b..14546f39f8 100644 --- a/dlls/ntdll/tests/path.c +++ b/dlls/ntdll/tests/path.c @@ -101,7 +101,8 @@ static void test_RtlIsDosDeviceName(void) { "", 0, 0 }, { "\\\\foo\\nul", 0, 0 }, { "c:\\nul:", 6, 6 }, - { "c:\\nul::", 0, 0 }, + { "c:\\nul::", 6, 6 }, + { "c:\\nul::::::", 6, 6 }, { "c:prn ", 4, 6 }, { "c:prn.......", 4, 6 }, { "c:prn... ...", 4, 6 },