Bugfix: GetFullPathName sets lpFilePart only when the last element

does not end with '\'.
This commit is contained in:
Juergen Schmied 1998-12-15 17:28:26 +00:00 committed by Alexandre Julliard
parent 1beaae5f9e
commit 30f503fd01
1 changed files with 8 additions and 2 deletions

View File

@ -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;
}