bool bPatchFileFailed; /**< Creating patch file failed */
DIFFSTATUS() { memset(this, 0, sizeof(*this)); } // start out with all flags clear
+ void MergeStatus(const DIFFSTATUS& other)
+ {
+ if (Identical == IDENTLEVEL_ALL)
+ Identical = Identical;
+ else if (
+ (Identical == IDENTLEVEL_EXCEPTLEFT && other.Identical != IDENTLEVEL_EXCEPTLEFT) ||
+ (Identical == IDENTLEVEL_EXCEPTRIGHT && other.Identical != IDENTLEVEL_EXCEPTRIGHT) ||
+ (Identical == IDENTLEVEL_EXCEPTMIDDLE && other.Identical != IDENTLEVEL_EXCEPTMIDDLE))
+ Identical = IDENTLEVEL_NONE;
+ if (other.bPatchFileFailed)
+ bPatchFileFailed = true;
+ if (other.bBinaries)
+ bBinaries = true;
+ std::copy(other.bMissingNL, other.bMissingNL + 3, bMissingNL);
+ }
};
class FilterCommentsManager;
m_diffWrapper.SetCodepage(m_ptBuf[0]->m_encoding.m_unicoding ?
CP_UTF8 : m_ptBuf[0]->m_encoding.m_codepage);
+ DIFFSTATUS status;
+
if (!HasSyncPoints())
{
// Save text buffer to file
m_diffWrapper.SetCreateDiffList(&m_diffList);
diffSuccess = !!m_diffWrapper.RunFileDiff();
+
+ // Read diff-status
+ m_diffWrapper.GetDiffStatus(&status);
+ if (bBinary) // believe caller if we were told these are binaries
+ status.bBinaries = true;
}
else
{
m_diffList.AppendDiffList(templist, nRealLine);
for (nBuffer = 0; nBuffer < m_nBuffers; nBuffer++)
nStartLine[nBuffer] += nLines[nBuffer];
+
+ // Read diff-status
+ DIFFSTATUS status_part;
+ m_diffWrapper.GetDiffStatus(&status_part);
+ if (bBinary) // believe caller if we were told these are binaries
+ status.bBinaries = true;
+ status.MergeStatus(status_part);
}
m_diffWrapper.SetCreateDiffList(&m_diffList);
}
- // Read diff-status
- DIFFSTATUS status;
- m_diffWrapper.GetDiffStatus(&status);
- if (bBinary) // believe caller if we were told these are binaries
- status.bBinaries = true;
-
// If comparing whitespaces and
// other file has EOL before EOF and other not...
if (!diffOptions.nIgnoreWhitespace && !diffOptions.bIgnoreBlankLines)