Commit 30f503fd authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

Bugfix: GetFullPathName sets lpFilePart only when the last element

does not end with '\'.
parent 1beaae5f
...@@ -1058,8 +1058,14 @@ DWORD WINAPI GetFullPathName32A( LPCSTR name, DWORD len, LPSTR buffer, ...@@ -1058,8 +1058,14 @@ DWORD WINAPI GetFullPathName32A( LPCSTR name, DWORD len, LPSTR buffer,
if (ret && lastpart) if (ret && lastpart)
{ {
LPSTR p = buffer + strlen(buffer); 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; return ret;
} }
......
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