GetShortPathName: always erase characters at the end of the new
string, and return only single backslashes.
This commit is contained in:
parent
fbace6eefe
commit
61f572a6ea
|
@ -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) );
|
||||
|
|
Loading…
Reference in New Issue