From 880252fd463233fce20ddacf77d561a808fd6397 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Fri, 19 Mar 2021 08:30:10 +0900 Subject: [PATCH] [SHELL32] Fix assertion failure in CDirectoryWatcher.cpp CORE-17511 --- dll/win32/shell32/shelldesktop/CDirectoryWatcher.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dll/win32/shell32/shelldesktop/CDirectoryWatcher.cpp b/dll/win32/shell32/shelldesktop/CDirectoryWatcher.cpp index 1e4a7015287..d5056a64faa 100644 --- a/dll/win32/shell32/shelldesktop/CDirectoryWatcher.cpp +++ b/dll/win32/shell32/shelldesktop/CDirectoryWatcher.cpp @@ -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