[BROWSEUI] SHExplorerParseCmdLine: Improve relative path handling
authorStanislav Motylkov <x86corez@gmail.com>
Sat, 2 Dec 2017 20:54:35 +0000 (23:54 +0300)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Tue, 5 Dec 2017 08:48:37 +0000 (10:48 +0200)
CORE-12882, CORE-13847

dll/win32/browseui/parsecmdline.cpp

index d2a0d2f..acf6176 100644 (file)
@@ -382,6 +382,12 @@ SHExplorerParseCmdLine(ExplorerCommandLineParseResults * pInfo)
             {
                 // Or just a plain old string.
 
+                WCHAR szPath[MAX_PATH];
+                DWORD result = GetFullPathNameW(strField, _countof(szPath), szPath, NULL);
+
+                if (result != 0 && result <= _countof(szPath) && PathFileExistsW(szPath))
+                    StringCchCopyW(strField, _countof(strField), szPath);
+
                 LPITEMIDLIST pidlPath = ILCreateFromPathW(strField);
 
                 pInfo->pidlPath = pidlPath;