From 3609a21258cfda79e9891502168b2963ec5cc67c Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sun, 5 May 2024 04:32:35 +0200 Subject: [PATCH] Fix same file opened 2 times with different sensitive case of path regression The regression is due to PR #14971 & commit 2531b4d12c4eddc6c0a519eb37c6edf25196619e ref: https://community.notepad-plus-plus.org/topic/25742/notepad-v8-6-6-release-candidate/3?_=1714876196550 --- PowerEditor/src/ScintillaComponent/Buffer.cpp | 2 +- PowerEditor/src/ScintillaComponent/DocTabView.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/ScintillaComponent/Buffer.cpp b/PowerEditor/src/ScintillaComponent/Buffer.cpp index 94df96ba1..133852f29 100644 --- a/PowerEditor/src/ScintillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScintillaComponent/Buffer.cpp @@ -1795,7 +1795,7 @@ BufferID FileManager::getBufferFromName(const TCHAR* name) { for (auto buf : _buffers) { - if (wcscmp(name, buf->getFullPathName()) == 0) + if (wcsicmp(name, buf->getFullPathName()) == 0) { if (!(buf->_referees.empty()) && buf->_referees[0]->isVisible()) { diff --git a/PowerEditor/src/ScintillaComponent/DocTabView.cpp b/PowerEditor/src/ScintillaComponent/DocTabView.cpp index 1a00960ea..db8dc1a2a 100644 --- a/PowerEditor/src/ScintillaComponent/DocTabView.cpp +++ b/PowerEditor/src/ScintillaComponent/DocTabView.cpp @@ -130,7 +130,7 @@ BufferID DocTabView::findBufferByName(const TCHAR * fullfilename) //-1 if not fo ::SendMessage(_hSelf, TCM_GETITEM, i, reinterpret_cast(&tie)); BufferID id = reinterpret_cast(tie.lParam); Buffer * buf = MainFileManager.getBufferByID(id); - if (wcscmp(fullfilename, buf->getFullPathName()) == 0) + if (wcsicmp(fullfilename, buf->getFullPathName()) == 0) { return id; }