Re: [Bug 521] WINE removes trailing backslash in GetFullPathNameA/W in dos_fs.c.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




This closes bug 521, and removes a couple of wine_todos from the regression test for pathes. The test for setting "lastpart" in both GetFullPathNameA/W was wrong (would always pass).


Mike


ChangeLog: * preserve trailing backslashes in GetFullPathName


Wine Bugs wrote:


------- Additional Comments From marcus@xxxxxxxxxxxxxx 2004-12-01 15:21 -------
Mike? any update? I think it is not applieds yet.
Index: files/dos_fs.c
===================================================================
RCS file: /home/wine/wine/files/dos_fs.c,v
retrieving revision 1.144
diff -u -r1.144 dos_fs.c
--- files/dos_fs.c	5 Jan 2004 23:42:09 -0000	1.144
+++ files/dos_fs.c	13 Jan 2004 05:22:59 -0000
@@ -1585,9 +1585,6 @@
 	}
     if (full_name.short_name[namelen-1]=='.')
 	full_name.short_name[(namelen--)-1] =0;
-    if (!driveletter)
-      if (full_name.short_name[namelen-1]=='\\')
-	full_name.short_name[(namelen--)-1] =0;
     TRACE("got %s\n", debugstr_w(full_name.short_name));
 
     /* If the lpBuffer buffer is too small, the return value is the
@@ -1655,7 +1652,7 @@
 
             if (lastpart)
             {
-                LPSTR p = buffer + strlen(buffer);
+                LPSTR p = buffer + strlen(buffer) - 1;
 
                 if (*p != '\\')
                 {
@@ -1681,7 +1678,7 @@
     DWORD ret = DOSFS_DoGetFullPathName( name, len, buffer );
     if (ret && (ret<=len) && buffer && lastpart)
     {
-        LPWSTR p = buffer + strlenW(buffer);
+        LPWSTR p = buffer + strlenW(buffer) - 1;
         if (*p != (WCHAR)'\\')
         {
             while ((p > buffer + 2) && (*p != (WCHAR)'\\')) p--;
Index: dlls/kernel/tests/path.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/path.c,v
retrieving revision 1.20
diff -u -r1.20 path.c
--- dlls/kernel/tests/path.c	18 Nov 2003 20:39:34 -0000	1.20
+++ dlls/kernel/tests/path.c	13 Jan 2004 05:23:00 -0000
@@ -112,14 +112,11 @@
   len=GetFullPathNameA(subpath,MAX_PATH,tmpstr,&strptr);
   ok(len, "GetFullPathNameA failed for: '%s'",subpath);
   if(HAS_TRAIL_SLASH_A(subpath)) {
-/* Wine strips off the trailing '\\'. Neither Win98 nor Win2k do this. */
-    todo_wine {
-      ok(strptr==NULL,
-         "%s: GetFullPathNameA should not return a filename ptr",errstr);
-      ok(lstrcmpiA(fullpath,tmpstr)==0,
-         "%s: GetFullPathNameA returned '%s' instead of '%s'",
-         errstr,tmpstr,fullpath);
-    }
+    ok(strptr==NULL,
+       "%s: GetFullPathNameA should not return a filename ptr",errstr);
+    ok(lstrcmpiA(fullpath,tmpstr)==0,
+       "%s: GetFullPathNameA returned '%s' instead of '%s'",
+       errstr,tmpstr,fullpath);
   } else {
     ok(lstrcmpiA(strptr,filename)==0,
        "%s: GetFullPathNameA returned '%s' instead of '%s'",

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux