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 ea0a9f9..299d65e 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);