-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 On 03/28/2010 03:44 PM, Jim Meyering wrote: > I expect to push this tiny patch by Javier (Cc'd). > Thanks, Javier! > > Without it, grep's --include=GLOB doesn't work. > >>From efd2b17d1431399233caa5e5b55c831a3459f66a Mon Sep 17 00:00:00 2001 > From: Javier Villavicencio <the_p...@gentoo.org> > Date: Sun, 28 Mar 2010 20:42:01 +0200 > Subject: [PATCH] exclude: fix the case of globs vs. EXCLUDE_INCLUDE > > * lib/exclude.c (excluded_file_pattern_p): Fix logic error that > made it so grep -r --include=GLOB* ... did not work. > --- > ChangeLog | 6 ++++++ > lib/exclude.c | 2 +- > 2 files changed, 7 insertions(+), 1 deletions(-) > > diff --git a/ChangeLog b/ChangeLog > index 12e0722..86403b2 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,9 @@ > +2010-03-28 Javier Villavicencio <the_p...@gentoo.org> > + > + exclude: fix the case of globs vs. EXCLUDE_INCLUDE > + * lib/exclude.c (excluded_file_pattern_p): Fix logic error that > + made it so grep -r --include=GLOB* ... did not work. > + > 2010-03-26 Jim Meyering <meyer...@redhat.com> > Eric Blake <ebl...@redhat.com> > > diff --git a/lib/exclude.c b/lib/exclude.c > index d4dcd76..34b5636 100644 > --- a/lib/exclude.c > +++ b/lib/exclude.c > @@ -342,7 +342,7 @@ excluded_file_pattern_p (struct exclude_segment const > *seg, char const *f) > { > char const *pattern = exclude[i].pattern; > int options = exclude[i].options; > - if (excluded != exclude_fnmatch (pattern, f, options)) > + if (exclude_fnmatch (pattern, f, options)) > return !excluded; > } > return excluded; > -- > 1.7.0.3.448.g82eeb >
Hello, I think you may have mixed up the two patches I reported against grep bug 29358, so, to clarify: That above is actually the patch that made most sense to me against the EXCLUDE_INCLUDE logic, as in: excluded_file_pattern_p should return !excluded on string match, not depending on the value excluded gets from options. The fix for GLOB matching is the second patch to grep's main.c, that just adds the EXCLUDE_WILDCARDS option to add_exclude(). -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEAREDAAYFAkuvqHoACgkQgvV6MZSadQpxsACgqtt6l+wS1X5Zw6+o4yWMEI7w H1QAn3XZDblo1BVbTSr3XRl53+tZoW7C =aYnP -----END PGP SIGNATURE-----