diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-04-29 19:04:41 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-04-29 19:05:17 -0700 |
commit | 5194f0b8ed4dc1f4ef62099a3652b541202109d3 (patch) | |
tree | 8866c98add979f32ec056d30d0d05b3f4ee6a8ff /tests | |
parent | f58a007d877819767440ee92d181fef6b0039706 (diff) | |
download | gnulib-5194f0b8ed4dc1f4ef62099a3652b541202109d3.tar.gz |
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.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test-exclude7.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test-exclude7.sh b/tests/test-exclude7.sh index a8ecf5b9e2..2293eafb18 100755 --- a/tests/test-exclude7.sh +++ b/tests/test-exclude7.sh @@ -28,8 +28,8 @@ Baz EOT cat > expected <<EOT -bar: 1 bar: 0 +bar: 1 EOT test-exclude in -include in -- bar > out || exit $? |