Commit a1d0e21b authored by Yuxuan Shui's avatar Yuxuan Shui Committed by Alexandre Julliard

shell32: PathResolve should remove trailing dot.

parent f59947bc
...@@ -694,10 +694,16 @@ static BOOL PathResolveA(char *path, const char **dirs, DWORD flags) ...@@ -694,10 +694,16 @@ static BOOL PathResolveA(char *path, const char **dirs, DWORD flags)
if (flags & PRF_VERIFYEXISTS) if (flags & PRF_VERIFYEXISTS)
{ {
if (PathFindOnPathExA(path, dirs, dwWhich)) if (PathFindOnPathExA(path, dirs, dwWhich))
{
if (!PathIsFileSpecA(path)) GetFullPathNameA(path, MAX_PATH, path, NULL);
return TRUE; return TRUE;
if (!is_file_spec && PathFileExistsDefExtA(path, dwWhich)) }
return TRUE; if (!is_file_spec)
if (!is_file_spec) GetFullPathNameA(path, MAX_PATH, path, NULL); {
GetFullPathNameA(path, MAX_PATH, path, NULL);
if (PathFileExistsDefExtA(path, dwWhich))
return TRUE;
}
SetLastError(ERROR_FILE_NOT_FOUND); SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE; return FALSE;
} }
...@@ -723,10 +729,16 @@ static BOOL PathResolveW(WCHAR *path, const WCHAR **dirs, DWORD flags) ...@@ -723,10 +729,16 @@ static BOOL PathResolveW(WCHAR *path, const WCHAR **dirs, DWORD flags)
if (flags & PRF_VERIFYEXISTS) if (flags & PRF_VERIFYEXISTS)
{ {
if (PathFindOnPathExW(path, dirs, dwWhich)) if (PathFindOnPathExW(path, dirs, dwWhich))
{
if (!PathIsFileSpecW(path)) GetFullPathNameW(path, MAX_PATH, path, NULL);
return TRUE; return TRUE;
if (!is_file_spec && PathFileExistsDefExtW(path, dwWhich)) }
return TRUE; if (!is_file_spec)
if (!is_file_spec) GetFullPathNameW(path, MAX_PATH, path, NULL); {
GetFullPathNameW(path, MAX_PATH, path, NULL);
if (PathFileExistsDefExtW(path, dwWhich))
return TRUE;
}
SetLastError(ERROR_FILE_NOT_FOUND); SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE; return FALSE;
} }
......
...@@ -2963,6 +2963,7 @@ static void test_PathResolve(void) ...@@ -2963,6 +2963,7 @@ static void test_PathResolve(void)
/* PRF_VERIFYEXISTS */ /* PRF_VERIFYEXISTS */
{ L"shellpath", PRF_VERIFYEXISTS, TRUE, testfile_lnk }, { L"shellpath", PRF_VERIFYEXISTS, TRUE, testfile_lnk },
{ L"shellpath.lnk", 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" }, { L"C:\\shellpath", PRF_VERIFYEXISTS, FALSE, L"C:\\shellpath" },
/* common extensions are tried even if PRF_TRYPROGRAMEXTENSIONS isn't passed */ /* 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 */ /* directories in dirs parameter are always searched first even if PRF_FIRSTDIRDEF isn't passed */
......
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