diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index df29ce05..ea887e57 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -87,7 +87,14 @@ DWORD WINAPI Notepad_plus::monitorFileOnChange(void * params) else { changes.Pop(dwAction, wstrFilename); - if (lstrcmp(fullFileName, wstrFilename.GetString()) == 0) + generic_string fn = wstrFilename.GetString(); + + // Fix monitoring files which are under root problem + size_t pos = fn.find(TEXT("\\\\")); + if (pos == 2) + fn.replace(pos, 2, TEXT("\\")); + + if (lstrcmp(fullFileName, fn.c_str()) == 0) { if (dwAction == FILE_ACTION_MODIFIED) { diff --git a/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.cpp b/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.cpp index f2d648a1..5f9cd4e5 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 (m_wstrDirectory.Right(1) != L"\\") + if (wstrFilename.Right(1) != L"\\") wstrFilename = m_wstrDirectory + L"\\" + wstrFilename; else wstrFilename = m_wstrDirectory + wstrFilename;