Skip to content
Snippets Groups Projects
Commit 41e25208 authored by Michael McCormack's avatar Michael McCormack Committed by Alexandre Julliard
Browse files

Preserve trailing backslashes in GetFullPathName.

parent 354f6629
No related branches found
No related tags found
No related merge requests found
......@@ -112,14 +112,11 @@ static void test_ValidPathA(CHAR *curdir, CHAR *subdir, CHAR *filename,
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'",
......
......@@ -1313,9 +1313,6 @@ static DWORD DOSFS_DoGetFullPathName( LPCWSTR name, DWORD len, LPWSTR result )
}
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
......@@ -1383,7 +1380,7 @@ DWORD WINAPI GetFullPathNameA( LPCSTR name, DWORD len, LPSTR buffer,
if (lastpart)
{
LPSTR p = buffer + strlen(buffer);
LPSTR p = buffer + strlen(buffer) - 1;
if (*p != '\\')
{
......@@ -1409,7 +1406,7 @@ DWORD WINAPI GetFullPathNameW( LPCWSTR name, DWORD len, LPWSTR buffer,
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--;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment