OSDN Git Service

Fix: WinMerge ignores a line without ## comment at the end of the line in file filter.
authorsdottaka <none@none>
Sun, 17 Apr 2011 00:31:39 +0000 (09:31 +0900)
committersdottaka <none@none>
Sun, 17 Apr 2011 00:31:39 +0000 (09:31 +0900)
Fix: file filter without "d: ..." (all f:) or without "f: ..." (all d:) does not work properly.

Src/FileFilterMgr.cpp

index e2c71fb..1fd7d9e 100644 (file)
@@ -142,7 +142,7 @@ static void AddFilterPattern(vector<FileFilterElement*> *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 '<whitespace>##'
@@ -291,6 +291,9 @@ FileFilter * FileFilterMgr::GetFilterByPath(LPCTSTR szFilterPath)
  */
 BOOL TestAgainstRegList(const vector<FileFilterElement*> *filterList, LPCTSTR szTest)
 {
+       if (filterList->size() == 0)
+               return FALSE;
+
        int ovector[30];
        char *compString = UCS2UTF8_ConvertToUtf8(szTest);
        size_t stringlen = strlen(compString);