RtlGetFullPathName_U should remove the trailing dot on directory

names.
This commit is contained in:
Alexandre Julliard 2005-06-24 11:55:28 +00:00
parent 0ea0f5fffd
commit b9a3f8fabf
2 changed files with 9 additions and 1 deletions

View File

@ -504,7 +504,12 @@ static inline void collapse_path( WCHAR *path, UINT mark )
}
/* skip to the next component */
while (*p && *p != '\\') p++;
if (*p == '\\') p++;
if (*p == '\\')
{
/* remove last dot in previous dir name */
if (p > path + mark && p[-1] == '.') memmove( p-1, p, (strlenW(p) + 1) * sizeof(WCHAR) );
else p++;
}
}
/* remove trailing spaces and dots (yes, Windows really does that, don't ask) */

View File

@ -239,6 +239,9 @@ static void test_RtlGetFullPathName_U()
{ "c:/test/.. ", "c:\\test\\", NULL},
{ "c:/TEST", "c:\\test", "test"},
{ "c:/test/file", "c:\\test\\file", "file"},
{ "c:/test./file", "c:\\test\\file", "file"},
{ "c:/test../file", "c:\\test.\\file", "file"},
{ "c:/test.. /file", "c:\\test.. \\file","file"},
{ "c:/test/././file", "c:\\test\\file", "file"},
{ "c:/test\\.\\.\\file", "c:\\test\\file", "file"},
{ "c:/test/\\.\\.\\file", "c:\\test\\file", "file"},