OSDN Git Service

Fix crash when creating Folder Compare Report that includes archive files in the...
authorsdottaka <none@none>
Sat, 28 Dec 2013 14:01:05 +0000 (23:01 +0900)
committersdottaka <none@none>
Sat, 28 Dec 2013 14:01:05 +0000 (23:01 +0900)
--HG--
branch : stable

Src/DirView.cpp

index 43edf2b..ad0d261 100644 (file)
@@ -3283,13 +3283,16 @@ struct FileCmpReport: public IFileCmpReport
        bool operator()(REPORT_TYPE nReportType, IListCtrl *pList, int nIndex, const String &sDestDir, String &sLinkPath)
        {
                const DIFFITEM &di = m_pDirView->GetDiffItem(nIndex);
-               if (di.diffcode.isDirectory() || !m_pDirView->IsItemNavigableDiff(di))
+               
+               sLinkPath = paths_ConcatPath(m_pDirView->GetDocument()->GetLeftBasePath(),
+                       paths_ConcatPath(di.diffFileInfo[0].path, di.diffFileInfo[0].filename));
+
+               if (di.diffcode.isDirectory() || !m_pDirView->IsItemNavigableDiff(di) || IsArchiveFile(sLinkPath))
                {
                        sLinkPath.clear();
                        return false;
                }
 
-               sLinkPath = paths_ConcatPath(di.diffFileInfo[0].path, di.diffFileInfo[0].filename);
                string_replace(sLinkPath, _T("\\"), _T("_"));
                sLinkPath += _T(".html");
 
@@ -3304,6 +3307,12 @@ struct FileCmpReport: public IFileCmpReport
                        pMergeDoc->CloseNow();
                }
 
+               MSG msg;
+               while (::PeekMessage(&msg, NULL, NULL, NULL, PM_NOREMOVE))
+                       if (!AfxGetApp()->PumpMessage())
+                               break;
+               GetMainFrame()->OnUpdateFrameTitle(FALSE);
+
                return true;
        }
 private: