This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  69d06a2c3c7cdcd296da4fe92d7ed7256c4d0395 (commit)
      from  542b0b1988681b10e7d1515e2e14d414bb98790f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=69d06a2c3c7cdcd296da4fe92d7ed7256c4d0395


commit 69d06a2c3c7cdcd296da4fe92d7ed7256c4d0395
Author: Paolo Bonzini <[email protected]>
Date:   Mon Apr 30 08:59:01 2012 +0200

    dfa: small fixes to single-byte range computation
    
    * src/dfa.c (parse_bracket_exp): Do not call regexec with an invalid
    subject.  Move declarations before all statements.

diff --git a/src/dfa.c b/src/dfa.c
index eefc817..a78e760 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -1104,6 +1104,11 @@ parse_bracket_exp (void)
             }
           else
             {
+              /* Defer to the system regex library about the meaning
+                 of range expressions.  */
+              regex_t re;
+              char pattern[6] = { '[', 0, '-', 0, ']', 0 };
+              char subject[2] = { 0, 0 };
               c1 = c;
               if (case_fold)
                 {
@@ -1111,17 +1116,16 @@ parse_bracket_exp (void)
                   c2 = tolower (c2);
                 }
 
-              /* Defer to the system regex library about the meaning
-                 of range expressions.  */
-              regex_t re;
-              char pattern[6] = { '[', c1, '-', c2, ']', 0 };
-              char subject[2] = { 0, 0 };
+              pattern[1] = c1;
+              pattern[3] = c2;
               regcomp (&re, pattern, REG_NOSUB);
               for (c = 0; c < NOTCHAR; ++c)
                 {
+                  if ((case_fold && isupper (c)) ||
+                      (MB_CUR_MAX > 1 && btowc (c) == WEOF))
+                    continue;
                   subject[0] = c;
-                  if (!(case_fold && isupper (c))
-                      && regexec (&re, subject, 0, NULL, 0) != REG_NOMATCH)
+                  if (regexec (&re, subject, 0, NULL, 0) != REG_NOMATCH)
                     setbit_case_fold_c (c, ccl);
                 }
               regfree (&re);

-----------------------------------------------------------------------

Summary of changes:
 src/dfa.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
grep

Reply via email to