grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.18-18-g7c67e84


From: Paul Eggert
Subject: grep branch, master, updated. v2.18-18-g7c67e84
Date: Mon, 03 Mar 2014 15:31:02 +0000

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  7c67e845b48bc49d1590803d1d60925bbebaeb2d (commit)
      from  d9f7791cf94cfe7ac8227298aa780c4462cfc312 (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=7c67e845b48bc49d1590803d1d60925bbebaeb2d


commit 7c67e845b48bc49d1590803d1d60925bbebaeb2d
Author: Norihiro Tanaka <address@hidden>
Date:   Mon Mar 3 21:43:48 2014 +0900

    grep: avoid to add same character to a bracket expression
    
    * src/main.c (trivial_ignore_case): Only when uppercase and/or
    lowercase is different from original character, add it to new pattern.

diff --git a/src/main.c b/src/main.c
index 14b7be2..1e7c79d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1933,15 +1933,20 @@ trivial_case_ignore (size_t len, char const *keys,
           memcpy (p, orig, n);
           p += n;
 
-          size_t lcbytes = WCRTOMB (p, lc, &mb_state);
-          if (lcbytes == (size_t) -1)
-            goto skip_case_ignore_optimization;
-          p += lcbytes;
-
-          size_t ucbytes = WCRTOMB (p, uc, &mb_state);
-          if (ucbytes == (size_t) -1 || ! mbsinit (&mb_state))
-            goto skip_case_ignore_optimization;
-          p += ucbytes;
+          if (lc != wc)
+            {
+              size_t lcbytes = WCRTOMB (p, lc, &mb_state);
+              if (lcbytes == (size_t) -1)
+                goto skip_case_ignore_optimization;
+              p += lcbytes;
+            }
+          if (uc != wc)
+            {
+              size_t ucbytes = WCRTOMB (p, uc, &mb_state);
+              if (ucbytes == (size_t) -1 || ! mbsinit (&mb_state))
+                goto skip_case_ignore_optimization;
+              p += ucbytes;
+            }
 
           *p++ = ']';
         }

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

Summary of changes:
 src/main.c |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

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