From: Takashi Sawanaka Date: Sat, 26 Jan 2019 15:27:39 +0000 (+0900) Subject: Fix bitbucket issue #138: Unique files are not shown X-Git-Tag: 2.16.5~471^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=82a80fe0a803e4a27015eab2ed190c34c907a34e;p=winmerge-jp%2Fwinmerge-jp.git Fix bitbucket issue #138: Unique files are not shown When comparing empty file and nonexistent file, `DIFFCODE::SAME` flag is set to the variable `code`, so change the flag to `DIFFCODE::DIFF` --- diff --git a/Src/FolderCmp.cpp b/Src/FolderCmp.cpp index cb8ca15f6..c995bd173 100644 --- a/Src/FolderCmp.cpp +++ b/Src/FolderCmp.cpp @@ -437,9 +437,9 @@ exitPrepAndCompare: if (nDirs > 2 && filepathUnpacked[2] != tFiles[2]) try { TFile(filepathUnpacked[2]).remove(); } catch (...) { LogErrorString(strutils::format(_T("DeleteFile(%s) failed"), filepathUnpacked[2].c_str())); } - if (!pCtxt->m_bIgnoreCodepage && - (code & DIFFCODE::COMPAREFLAGS) == DIFFCODE::SAME && - !std::equal(encoding + 1, encoding + nDirs, encoding)) + // When comparing empty file and nonexistent file, `DIFFCODE::SAME` flag is set to the variable `code`, so change the flag to `DIFFCODE::DIFF` + // Also when disabling ignore codepage option and the encodings of files are not equal, change the flag to `DIFFCODE::DIFF even if `DIFFCODE::SAME` flag is set to the variable `code` + if (!di.diffcode.existAll() || (!pCtxt->m_bIgnoreCodepage && !std::equal(encoding + 1, encoding + nDirs, encoding))) code = (code & ~DIFFCODE::COMPAREFLAGS) | DIFFCODE::DIFF; } else if (nCompMethod == CMP_BINARY_CONTENT)