shell32: PathResolve should remove trailing dot.
This commit is contained in:
parent
f59947bc10
commit
a1d0e21b0a
2 changed files with 19 additions and 6 deletions
|
@ -694,10 +694,16 @@ static BOOL PathResolveA(char *path, const char **dirs, DWORD flags)
|
|||
if (flags & PRF_VERIFYEXISTS)
|
||||
{
|
||||
if (PathFindOnPathExA(path, dirs, dwWhich))
|
||||
{
|
||||
if (!PathIsFileSpecA(path)) GetFullPathNameA(path, MAX_PATH, path, NULL);
|
||||
return TRUE;
|
||||
if (!is_file_spec && PathFileExistsDefExtA(path, dwWhich))
|
||||
return TRUE;
|
||||
if (!is_file_spec) GetFullPathNameA(path, MAX_PATH, path, NULL);
|
||||
}
|
||||
if (!is_file_spec)
|
||||
{
|
||||
GetFullPathNameA(path, MAX_PATH, path, NULL);
|
||||
if (PathFileExistsDefExtA(path, dwWhich))
|
||||
return TRUE;
|
||||
}
|
||||
SetLastError(ERROR_FILE_NOT_FOUND);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -723,10 +729,16 @@ static BOOL PathResolveW(WCHAR *path, const WCHAR **dirs, DWORD flags)
|
|||
if (flags & PRF_VERIFYEXISTS)
|
||||
{
|
||||
if (PathFindOnPathExW(path, dirs, dwWhich))
|
||||
{
|
||||
if (!PathIsFileSpecW(path)) GetFullPathNameW(path, MAX_PATH, path, NULL);
|
||||
return TRUE;
|
||||
if (!is_file_spec && PathFileExistsDefExtW(path, dwWhich))
|
||||
return TRUE;
|
||||
if (!is_file_spec) GetFullPathNameW(path, MAX_PATH, path, NULL);
|
||||
}
|
||||
if (!is_file_spec)
|
||||
{
|
||||
GetFullPathNameW(path, MAX_PATH, path, NULL);
|
||||
if (PathFileExistsDefExtW(path, dwWhich))
|
||||
return TRUE;
|
||||
}
|
||||
SetLastError(ERROR_FILE_NOT_FOUND);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -2963,6 +2963,7 @@ static void test_PathResolve(void)
|
|||
/* PRF_VERIFYEXISTS */
|
||||
{ L"shellpath", PRF_VERIFYEXISTS, TRUE, testfile_lnk },
|
||||
{ L"shellpath.lnk", PRF_VERIFYEXISTS, TRUE, testfile_lnk },
|
||||
{ L"shellpath.lnk.", PRF_VERIFYEXISTS, TRUE, testfile_lnk },
|
||||
{ L"C:\\shellpath", PRF_VERIFYEXISTS, FALSE, L"C:\\shellpath" },
|
||||
/* common extensions are tried even if PRF_TRYPROGRAMEXTENSIONS isn't passed */
|
||||
/* directories in dirs parameter are always searched first even if PRF_FIRSTDIRDEF isn't passed */
|
||||
|
|
Loading…
Add table
Reference in a new issue