[ntdll/path] Fix failing test on windows

Paul Vriens Paul.Vriens at xs4all.nl
Fri Aug 18 03:57:40 CDT 2006


Hi,

W2K, XP and W2K3 ignore all trailing ':'. NT4 doesn't (so the tests
will fail on NT4). 
Also 'fixed' Wine to remove all trailing ':'.

I don't think there's a need to cover all versions of windows in these
tests. If there is, we have to change the test to cope with multiple outcomes.

Changelog
  Fix failing test on windows

Cheers,

Paul.
---
 dlls/ntdll/path.c       |    2 +-
 dlls/ntdll/tests/path.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c
index 78ee9fd..84c15a4 100644
--- a/dlls/ntdll/path.c
+++ b/dlls/ntdll/path.c
@@ -339,7 +339,7 @@ ULONG WINAPI RtlIsDosDeviceName_U( PCWST
     }
 
     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 14af1cf..14546f3 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 },
-- 
1.4.1.1




More information about the wine-patches mailing list