summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--THANKS1
-rw-r--r--lib/savedir.c2
-rw-r--r--tests/include-exclude5
4 files changed, 9 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 6d876557..6c9943e9 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ GNU grep NEWS -*- outline -*-
** Bug fixes
+ The --include option works once again. [bug introduced in 2.6]
+
Using any of the --include or --exclude* options would cause a NULL
dereference. [bug introduced in 2.6]
diff --git a/THANKS b/THANKS
index e1273de0..c960be20 100644
--- a/THANKS
+++ b/THANKS
@@ -65,6 +65,7 @@ Paolo Bonzini <bonzini@gnu.org>
Paul Eggert <eggert@twinsun.com>
Paul Kimoto <kimoto@spacenet.tn.cornell.edu>
Phillip C. Brisco <phillip.craig.brisco@ccmail.census.gov>
+Philipp Kohlbecher <xt28@gmx.de>
Philippe Defert <Philippe.Defert@cern.ch>
Philippe De Muyter <phdm@info.ucl.ac.be>
Philip Hazel <ph10@cus.cam.ac.uk>
diff --git a/lib/savedir.c b/lib/savedir.c
index 94e5f121..53f8c7be 100644
--- a/lib/savedir.c
+++ b/lib/savedir.c
@@ -112,7 +112,7 @@ savedir (const char *dir, off_t name_size, struct exclude *included_patterns,
&& !isdir1 (dir, dp->d_name))
{
if (included_patterns
- && !excluded_file_name (included_patterns, dp->d_name))
+ && excluded_file_name (included_patterns, dp->d_name))
continue;
if (excluded_patterns
&& excluded_file_name (excluded_patterns, dp->d_name))
diff --git a/tests/include-exclude b/tests/include-exclude
index e77c126d..f4e5d9d2 100644
--- a/tests/include-exclude
+++ b/tests/include-exclude
@@ -12,6 +12,7 @@ printf '%s\n' x/b:b x/dir/d:d > exp-not-a || framework_failure_
printf '%s\n' x/dir/d:d > exp-not-ab || framework_failure_
printf '%s\n' x/a:a x/b:b > exp-not-d || framework_failure_
printf '%s\n' x/a:a x/b:b > exp-not-dir || framework_failure_
+printf '%s\n' x/a:a > exp-a || framework_failure_
grep -r --exclude='a*' . x > out || fail=1
sort out > k && mv k out
@@ -29,4 +30,8 @@ grep -r --exclude-dir=dir . x > out || fail=1
sort out > k && mv k out
compare out exp-not-dir || fail=1
+grep -r --include=a . x > out || fail=1
+# no need to sort
+compare out exp-a || fail=1
+
Exit $fail