Bugfix: GetFullPathName sets lpFilePart only when the last element does not end with '\'.
diff --git a/files/dos_fs.c b/files/dos_fs.c index 9541452..0919d03 100644 --- a/files/dos_fs.c +++ b/files/dos_fs.c
@@ -1058,8 +1058,14 @@ 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; }