bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] exclude: fix the case of globs vs. EXCLUDE_INCLUDE


From: Javier Villavicencio
Subject: Re: [PATCH] exclude: fix the case of globs vs. EXCLUDE_INCLUDE
Date: Sun, 28 Mar 2010 16:05:30 -0300
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100327 Thunderbird/3.0.3

-----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 <address@hidden>
> 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  <address@hidden>
> +
> +     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  <address@hidden>
>           Eric Blake  <address@hidden>
> 
> 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-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]