Bugfix: GetFullPathName sets lpFilePart only when the last element
does not end with '\'.
This commit is contained in:
parent
1beaae5f9e
commit
30f503fd01
|
@ -1058,8 +1058,14 @@ DWORD WINAPI GetFullPathName32A( LPCSTR name, DWORD len, LPSTR buffer,
|
|||
if (ret && lastpart)
|
||||
{
|
||||
LPSTR p = buffer + strlen(buffer);
|
||||
while ((p > buffer + 2) && (*p != '\\')) p--;
|
||||
*lastpart = p + 1;
|
||||
|
||||
/* if the path closed with '\', *lastpart is 0 */
|
||||
if (*p != '\\')
|
||||
{
|
||||
while ((p > buffer + 2) && (*p != '\\')) p--;
|
||||
*lastpart = p + 1;
|
||||
}
|
||||
else *lastpart = NULL;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue