OSDN Git Service

Fix issue with ApplyPatch plugin not functioning correctly when 'Plugins->Manual...
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Thu, 13 Apr 2023 12:53:34 +0000 (21:53 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Thu, 13 Apr 2023 12:53:34 +0000 (21:53 +0900)
Plugins/dlls/ApplyPatch.sct
Src/OpenView.cpp

index d9fd0d3..ba07ff3 100644 (file)
@@ -147,7 +147,7 @@ Function PackFile(fileSrc, fileDst, pbChanged, pSubcode)
 End Function
 
 Function IsFolder(file)
-    IsFolder = True
+    IsFolder = IsPatchFile(file)
 End Function
 
 Function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode)
index 497b1af..7af0b79 100644 (file)
@@ -34,6 +34,7 @@
 #include "LanguageSelect.h"
 #include "Win_VersionHelper.h"
 #include "OptionsProject.h"
+#include "Merge7zFormatMergePluginImpl.h"
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -629,13 +630,19 @@ void COpenView::OnCompare(UINT nID)
                return;
        }
 
-       pathsType = paths::GetPairComparability(m_files, IsArchiveFile);
-
-       if (pathsType == paths::DOES_NOT_EXIST &&
-               !std::any_of(m_files.begin(), m_files.end(), [](const auto& path) { return paths::IsURL(path); }))
+       PackingInfo tmpPackingInfo(m_strUnpackerPipeline);
+       PrediffingInfo tmpPrediffingInfo(m_strPredifferPipeline);
        {
-               LangMessageBox(IDS_ERROR_INCOMPARABLE, MB_ICONSTOP);
-               return;
+               Merge7zFormatMergePluginScope scope(&tmpPackingInfo);
+
+               pathsType = paths::GetPairComparability(m_files, IsArchiveFile);
+
+               if (pathsType == paths::DOES_NOT_EXIST &&
+                       !std::any_of(m_files.begin(), m_files.end(), [](const auto& path) { return paths::IsURL(path); }))
+               {
+                       LangMessageBox(IDS_ERROR_INCOMPARABLE, MB_ICONSTOP);
+                       return;
+               }
        }
 
        for (int index = 0; index < nFiles; index++)
@@ -712,8 +719,6 @@ void COpenView::OnCompare(UINT nID)
                GetParentFrame()->PostMessage(WM_CLOSE);
 
        // Copy the values in pDoc as it will be invalid when COpenFrame is closed. 
-       PackingInfo tmpPackingInfo(pDoc->m_strUnpackerPipeline);
-       PrediffingInfo tmpPrediffingInfo(m_strPredifferPipeline);
        PathContext tmpPathContext(pDoc->m_files);
        std::array<fileopenflags_t, 3> dwFlags = pDoc->m_dwFlags;
        bool recurse = pDoc->m_bRecurse;