Allow pathname_matches_p to be called if match is predicate
authorNelson Ferreira <nferreira9@bloomberg.net>
Thu, 2 Apr 2020 15:58:33 +0000 (11:58 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 3 Apr 2020 13:36:00 +0000 (09:36 -0400)
      * src/dired.c(dfr_inner): Rely on caller of dfr_inner to
        guarantee that match is a predicate if the bufp is NULL.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/dired.c

index 1ee2fca..ec6c116 100644 (file)
@@ -361,7 +361,7 @@ dfr_inner(dirent_t *res,
        }
 
 #if USE_MATCH_ARG
-       if (!NILP(match) && bufp && !pathname_matches_p(name, match, bufp)) {
+       if (result_p && !NILP(match) && !pathname_matches_p(name, match, bufp)) {
                result_p = 0;
        }
 #endif