From 30f503fd01ad8cd919e2da39a8bcf8443ebccb73 Mon Sep 17 00:00:00 2001 From: Juergen Schmied Date: Tue, 15 Dec 1998 17:28:26 +0000 Subject: [PATCH] Bugfix: GetFullPathName sets lpFilePart only when the last element does not end with '\'. --- files/dos_fs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/files/dos_fs.c b/files/dos_fs.c index 95414528e4b..0919d0306c5 100644 --- a/files/dos_fs.c +++ b/files/dos_fs.c @@ -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; } -- 2.11.4.GIT