Commit 61f572a6 authored by Uwe Bonnes's avatar Uwe Bonnes Committed by Alexandre Julliard

GetShortPathName: always erase characters at the end of the new

string, and return only single backslashes.
parent fbace6ee
......@@ -939,8 +939,12 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath,
/* check for path delimiters and reproduce them */
if ( longpath[lp] == '\\' || longpath[lp] == '/' ) {
tmpshortpath[sp] = longpath[lp];
sp++;
if (!sp || tmpshortpath[sp-1]!= '\\')
{
/* strip double "\\" */
tmpshortpath[sp] = '\\';
sp++;
}
lp++;
continue;
}
......@@ -967,6 +971,7 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath,
SetLastError ( ERROR_FILE_NOT_FOUND );
return 0;
}
tmpshortpath[sp] = 0;
lstrcpynA ( shortpath, tmpshortpath, shortlen );
TRACE("returning %s\n", debugstr_a(shortpath) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment