]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
action_if_pattern_matches(): Always count matching rows.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 5 Apr 2015 14:07:28 +0000 (14:07 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 12 Aug 2015 21:23:47 +0000 (23:23 +0200)
We missed to do this if PM_NO_PATTERN_MATCHES_EVERYTHING is set.

afs.c

diff --git a/afs.c b/afs.c
index ea0a9f9f310d55f3e4fc56377a3583937e1bd92d..299d65ebd287cf7fe1122fab1c25b37cb9a02360 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -365,8 +365,11 @@ static int action_if_pattern_matches(struct osl_row *row, void *data)
        name = (char *)name_obj.data;
        if ((!name || !*name) && (pmd->pm_flags & PM_SKIP_EMPTY_NAME))
                return 1;
-       if (!pmd->patterns.size && (pmd->pm_flags & PM_NO_PATTERN_MATCHES_EVERYTHING))
+       if (pmd->patterns.size == 0 &&
+                       (pmd->pm_flags & PM_NO_PATTERN_MATCHES_EVERYTHING)) {
+               pmd->num_matches++;
                return pmd->action(pmd->table, row, name, pmd->data);
+       }
        for (p = pattern_txt; p < pattern_txt + pmd->patterns.size;
                        p += strlen(p) + 1) {
                ret = fnmatch(p, name, pmd->fnmatch_flags);