bug-grep
[Top][All Lists]
Advanced

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

Re: suggested fixes for dfa.c


From: Jim Meyering
Subject: Re: suggested fixes for dfa.c
Date: Fri, 29 Apr 2011 12:08:49 +0200

Aharon Robbins wrote:
> Upon comparing grep's dfa.c to the development gawk, I suggest the
> following fixes.
>
> 1. Remove the #ifdef GAWK - upcoming gawk supports \s and \S
> 2. Move add_utf8_anychar into the MBS_SUPPORT #ifdef.  This latter has
>    been reported on the list before - I thought it'd been checked in even.
>    :-)

Thanks for the patch.

However, would you please convert those to two actual commits (in a cloned
grep working directory), each with its own commit log?  Then you can send
the output of "git format-patch --stdout -2 -p" and I can simply run
"git am EACH_MESSAGE" to apply them without hassling with attribution --
you'll be listed as the "Author" -- separating them, or writing log messages.

It's a good exercise, and a practice you should encourage
all gawk contributors to follow, as well.

BTW, you sent a similar fix, but for a different function.
You can let this serve as a model for the commit log:

  commit 24d9aefd4be68f06b8c6c74b07e51736958d24fd
  Author: Aharon Robbins <address@hidden>
  Date:   Thu Sep 16 13:12:11 2010 +0200

      dfa: fix compilation when not using MBS

      * src/dfa.c (prepare_wc_buf) [!MBS_SUPPORT]: Do not compile this
      function.


> -------------------------
> --- dfa.c     2011-04-29 12:26:39.000000000 +0300
> +++ /home/arnold/Gnu/gawk/gawk.git/dfa.c      2011-04-29 12:28:46.000000000 
> +0300
> @@ -1336,7 +1369,6 @@
>            laststart = 0;
>            return lasttok = CSET + charclass_index(ccl);
>
> -#ifndef GAWK
>          case 's':
>          case 'S':
>            if (!backslash || (syntax_bits & RE_NO_GNU_OPS))
> @@ -1349,7 +1381,6 @@
>              notset(ccl);
>            laststart = 0;
>            return lasttok = CSET + charclass_index(ccl);
> -#endif
>
>          case 'w':
>          case 'W':
> @@ -1487,7 +1518,6 @@
>        addtok(CAT);
>      }
>  }
> -#endif
>
>  static void
>  add_utf8_anychar (void)
> @@ -1537,6 +1567,7 @@
>        addtok (OR);
>      }
>  }
> +#endif
>
>  /* The grammar understood by the parser is as follows.
>



reply via email to

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