diff tests/test-exclude7.sh @ 16806:babe19575e66

exclude: process exclude and include directives in order This restores the pre-2009 behavior, and is part of a fix of a grep bug reported by Quentin Arce in <http://lists.gnu.org/archive/html/bug-grep/2012-04/msg00056.html>. * lib/exclude.c (struct exclude): Remove 'tail' member. (new_exclude_segment): Prepend the new segment instead of appending. Return void, since that's now more convenient. (file_pattern_matches): Renamed from excluded_file_pattern_p. (file_name_matches): Renamed from excluded_file_name_p. (file_pattern_matches, file_name_matches): Return true if the pattern matches, not if it excludes. All callers changed. (excluded_file_name): Process the list in reverse order; since the list is now reversed this restores the pre-2009 behavior. (add_exclude): Adjust to new reversed-order list. Use local var rather than macro, for clarity. * tests/test-exclude7.sh: Adjust to corrected behavior.
author Paul Eggert <eggert@cs.ucla.edu>
date Sun, 29 Apr 2012 19:04:41 -0700
parents 8250f2777afc
children e542fd46ad6f
line wrap: on
line diff
--- a/tests/test-exclude7.sh	Sun Apr 29 17:02:13 2012 -0700
+++ b/tests/test-exclude7.sh	Sun Apr 29 19:04:41 2012 -0700
@@ -28,8 +28,8 @@
 EOT
 
 cat > expected <<EOT
+bar: 0
 bar: 1
-bar: 0
 EOT
 
 test-exclude in -include in -- bar > out || exit $?