[SHELL32] Fix assertion failure in CDirectoryWatcher.cpp
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Thu, 18 Mar 2021 23:30:10 +0000 (08:30 +0900)
committerKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Thu, 18 Mar 2021 23:30:10 +0000 (08:30 +0900)
CORE-17511

dll/win32/shell32/shelldesktop/CDirectoryWatcher.cpp

index 1e4a701..d5056a6 100644 (file)
@@ -162,8 +162,11 @@ void CDirectoryWatcher::ProcessNotification()
         // convert to long pathname if it contains '~'
         if (StrChrW(szPath, L'~') != NULL)
         {
-            GetLongPathNameW(szPath, szName, _countof(szName));
-            lstrcpynW(szPath, szName, _countof(szPath));
+            if (GetLongPathNameW(szPath, szName, _countof(szName)) &&
+                !PathIsRelativeW(szName))
+            {
+                lstrcpynW(szPath, szName, _countof(szPath));
+            }
         }
 
         // convert action to event