[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug #29358] segmentation fault in isdir1 with grep-2.6.1
From: |
Jim Meyering |
Subject: |
Re: [bug #29358] segmentation fault in isdir1 with grep-2.6.1 |
Date: |
Sun, 28 Mar 2010 17:38:25 +0200 |
Philipp Kohlbecher wrote:
> Follow-up Comment #2, bug #29358 (project grep):
> Just noticed the fix in the git repo. While it makes a lot more sense than my
> hack below, that fix also leaves the --include switch non-functional.
Thanks for mentioning that.
Here's the fix I expect to push soon:
>From cd8b6178b965e19daa9d106f11d82809097119ab Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 28 Mar 2010 17:32:48 +0200
Subject: [PATCH] grep: fix --include
* lib/savedir.c (savedir): Fix logic error. Introduced by commit
bf3bd92c, "build: adapt to the newer exclude API we now get from gnulib"
* tests/include-exclude: Test for this bug by exercising --include, too.
* NEWS (Bug fixes): Mention it.
Reported by Philipp Kohlbecher in http://savannah.gnu.org/bugs/?29358
---
NEWS | 2 ++
THANKS | 1 +
lib/savedir.c | 2 +-
tests/include-exclude | 5 +++++
4 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/NEWS b/NEWS
index 6d87655..6c9943e 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 e1273de..c960be2 100644
--- a/THANKS
+++ b/THANKS
@@ -65,6 +65,7 @@ Paolo Bonzini <address@hidden>
Paul Eggert <address@hidden>
Paul Kimoto <address@hidden>
Phillip C. Brisco <address@hidden>
+Philipp Kohlbecher <address@hidden>
Philippe Defert <address@hidden>
Philippe De Muyter <address@hidden>
Philip Hazel <address@hidden>
diff --git a/lib/savedir.c b/lib/savedir.c
index 94e5f12..53f8c7b 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 e77c126..f4e5d9d 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
--
1.7.0.3.448.g82eeb
- [bug #29358] segmentation fault in isdir1 with grep-2.6.1, Brian Gough, 2010/03/27
- [bug #29358] segmentation fault in isdir1 with grep-2.6.1, Philipp Kohlbecher, 2010/03/28
- [bug #29358] segmentation fault in isdir1 with grep-2.6.1, Philipp Kohlbecher, 2010/03/28
- Re: [bug #29358] segmentation fault in isdir1 with grep-2.6.1,
Jim Meyering <=
- [bug #29358] segmentation fault in isdir1 with grep-2.6.1, Jim Meyering, 2010/03/28
- [bug #29358] segmentation fault in isdir1 with grep-2.6.1, Philipp Kohlbecher, 2010/03/28
- [bug #29358] segmentation fault in isdir1 with grep-2.6.1, Javier Villavicencio, 2010/03/28
- [bug #29358] segmentation fault in isdir1 with grep-2.6.1, Javier Villavicencio, 2010/03/28
- Re: [bug #29358] segmentation fault in isdir1 with grep-2.6.1, Jim Meyering, 2010/03/28