From 449015a362bfb8301a36ab9b992be64f644beb1f Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Fri, 16 Aug 2024 09:55:33 +0900 Subject: [PATCH] Fix issue #2408: WinMerge incorrectly states "The selected files are identical" --- Src/MainFrm.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Src/MainFrm.cpp b/Src/MainFrm.cpp index 6d0c801970c..9264fb3b4cf 100644 --- a/Src/MainFrm.cpp +++ b/Src/MainFrm.cpp @@ -797,18 +797,20 @@ bool CMainFrame::ShowAutoMergeDoc(UINT nID, IDirDoc * pDirDoc, nID = ID_MERGE_COMPARE_TEXT + preferredWindowType; } FileFilterHelper filterImg, filterBin; + const String& imgPatterns = GetOptionsMgr()->GetString(OPT_CMP_IMG_FILEPATTERNS); filterImg.UseMask(true); - filterImg.SetMask(GetOptionsMgr()->GetString(OPT_CMP_IMG_FILEPATTERNS)); + filterImg.SetMask(imgPatterns); + const String& binPatterns = GetOptionsMgr()->GetString(OPT_CMP_BIN_FILEPATTERNS); filterBin.UseMask(true); - filterBin.SetMask(GetOptionsMgr()->GetString(OPT_CMP_BIN_FILEPATTERNS)); + filterBin.SetMask(binPatterns); for (int pane = 0; pane < nFiles; ++pane) { if (CWebPageDiffFrame::MatchURLPattern(ifileloc[pane].filepath)) return ShowWebDiffDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, infoPrediffer, dynamic_cast(pOpenParams)); String filepath = ifileloc[pane].filepath + unpackedFileExtension; - if (filterImg.includeFile(filepath) && CImgMergeFrame::IsLoadable()) + if (!imgPatterns.empty() && filterImg.includeFile(filepath) && CImgMergeFrame::IsLoadable()) return ShowImgMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, infoPrediffer, dynamic_cast(pOpenParams)); - else if (filterBin.includeFile(filepath) && CHexMergeView::IsLoadable()) + else if (!binPatterns.empty() && filterBin.includeFile(filepath) && CHexMergeView::IsLoadable()) return ShowHexMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, infoPrediffer, dynamic_cast(pOpenParams)); } switch (std::abs(static_cast(nID)))