From f8523c9ac4343a941f40f5124acbfeb4c6c24aa3 Mon Sep 17 00:00:00 2001 From: sdottaka Date: Sun, 17 Apr 2011 09:31:39 +0900 Subject: [PATCH] Fix: WinMerge ignores a line without ## comment at the end of the line in file filter. Fix: file filter without "d: ..." (all f:) or without "f: ..." (all d:) does not work properly. --- Src/FileFilterMgr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Src/FileFilterMgr.cpp b/Src/FileFilterMgr.cpp index e2c71fbf6..1fd7d9e5e 100644 --- a/Src/FileFilterMgr.cpp +++ b/Src/FileFilterMgr.cpp @@ -142,7 +142,7 @@ static void AddFilterPattern(vector *filterList, String & st // Ignore lines beginning with '##' size_t pos = str.find(commentLeader); - if (pos == str.npos) + if (pos == 0) return; // Find possible comment-separator '##' @@ -291,6 +291,9 @@ FileFilter * FileFilterMgr::GetFilterByPath(LPCTSTR szFilterPath) */ BOOL TestAgainstRegList(const vector *filterList, LPCTSTR szTest) { + if (filterList->size() == 0) + return FALSE; + int ovector[30]; char *compString = UCS2UTF8_ConvertToUtf8(szTest); size_t stringlen = strlen(compString); -- 2.11.0