From 52df792cd9f61c1591350e6f0304c9919bc3abf1 Mon Sep 17 00:00:00 2001 From: willdevgh Date: Fri, 8 Jul 2016 19:13:54 +0800 Subject: [PATCH] Fix bug of monitoring not working for files under root Closes #2061 To reproduce such bug, the file foo.txt to monitor should be in the root folder (ie. c:\foo.txt). The algorithm is check if folder path has '\' at the end, if no, then add a '\' then append file name. In the original code, instead of checking folder path, the file name is checked. Since file name doesn't contain '\' (ie. c:\temp), a '\' is always added on folder path which has no '\' at the end. it works for none root folder such as C:\, E:\ or F:\. --- .../ReadDirectoryChanges/ReadDirectoryChangesPrivate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.cpp b/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.cpp index 0c320d6a..a8c937a7 100644 --- a/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.cpp +++ b/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.cpp @@ -149,7 +149,7 @@ void CReadChangesRequest::ProcessNotification() CStringW wstrFilename(fni.FileName, fni.FileNameLength/sizeof(wchar_t)); // Handle a trailing backslash, such as for a root directory. - if (wstrFilename.Right(1) != L"\\") + if (m_wstrDirectory.Right(1) != L"\\") wstrFilename = m_wstrDirectory + L"\\" + wstrFilename; else wstrFilename = m_wstrDirectory + wstrFilename;