grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.6.2-18-g03d8cfa


From: Jim Meyering
Subject: grep branch, master, updated. v2.6.2-18-g03d8cfa
Date: Thu, 01 Apr 2010 08:06:20 +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  03d8cfa74e36ad2e8daf6b412533aa37cc099363 (commit)
       via  d2480e520cda846b8adaa9f064e34a050e238875 (commit)
      from  df78af01a400f083c7c276ac02c1b6695d3dff94 (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=03d8cfa74e36ad2e8daf6b412533aa37cc099363


commit 03d8cfa74e36ad2e8daf6b412533aa37cc099363
Author: Jim Meyering <address@hidden>
Date:   Thu Mar 25 08:28:28 2010 +0100

    grep: remove unnecessary code
    
    * src/main.c (print_line_middle): Now that we use RE_ICASE
    (enabled in commit 70e23616, "dfa: rewrite handling of multibyte
    case_fold lexing"), this case-conversion code is useless and wasteful.
    Remove it.

diff --git a/src/main.c b/src/main.c
index 3fdcfb9..8c9e776 100644
--- a/src/main.c
+++ b/src/main.c
@@ -724,32 +724,10 @@ print_line_middle (const char *beg, const char *lim,
   size_t match_offset;
   const char *cur = beg;
   const char *mid = NULL;
-  char *buf;
-  const char *ibeg;
 
-  /* XXX - should not be needed anymore now that we use RE_ICASE.
-     Revisit after 2.6.x stabilizes.  */
-  if (match_icase
-#ifdef MBS_SUPPORT
-      && MB_CUR_MAX == 1
-#endif
-     )
-    {
-      int i = lim - beg;
-
-      ibeg = buf = xmalloc(i);
-      while (--i >= 0)
-       buf[i] = tolower((unsigned char) beg[i]);
-    }
-  else
-    {
-      buf = NULL;
-      ibeg = beg;
-    }
-
-  while (   lim > cur
-        && ((match_offset = execute(ibeg, lim - beg, &match_size,
-                                    ibeg + (cur - beg))) != (size_t) -1))
+  while (cur < lim
+        && ((match_offset = execute(beg, lim - beg, &match_size,
+                                    beg + (cur - beg))) != (size_t) -1))
     {
       char const *b = beg + match_offset;
 
@@ -793,8 +771,6 @@ print_line_middle (const char *beg, const char *lim,
       cur = b + match_size;
     }
 
-  free (buf);  /* XXX */
-
   if (only_matching)
     cur = lim;
   else if (mid)

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=d2480e520cda846b8adaa9f064e34a050e238875


commit 03d8cfa74e36ad2e8daf6b412533aa37cc099363
Author: Jim Meyering <address@hidden>
Date:   Thu Mar 25 08:28:28 2010 +0100

    grep: remove unnecessary code
    
    * src/main.c (print_line_middle): Now that we use RE_ICASE
    (enabled in commit 70e23616, "dfa: rewrite handling of multibyte
    case_fold lexing"), this case-conversion code is useless and wasteful.
    Remove it.

diff --git a/src/main.c b/src/main.c
index 3fdcfb9..8c9e776 100644
--- a/src/main.c
+++ b/src/main.c
@@ -724,32 +724,10 @@ print_line_middle (const char *beg, const char *lim,
   size_t match_offset;
   const char *cur = beg;
   const char *mid = NULL;
-  char *buf;
-  const char *ibeg;
 
-  /* XXX - should not be needed anymore now that we use RE_ICASE.
-     Revisit after 2.6.x stabilizes.  */
-  if (match_icase
-#ifdef MBS_SUPPORT
-      && MB_CUR_MAX == 1
-#endif
-     )
-    {
-      int i = lim - beg;
-
-      ibeg = buf = xmalloc(i);
-      while (--i >= 0)
-       buf[i] = tolower((unsigned char) beg[i]);
-    }
-  else
-    {
-      buf = NULL;
-      ibeg = beg;
-    }
-
-  while (   lim > cur
-        && ((match_offset = execute(ibeg, lim - beg, &match_size,
-                                    ibeg + (cur - beg))) != (size_t) -1))
+  while (cur < lim
+        && ((match_offset = execute(beg, lim - beg, &match_size,
+                                    beg + (cur - beg))) != (size_t) -1))
     {
       char const *b = beg + match_offset;
 
@@ -793,8 +771,6 @@ print_line_middle (const char *beg, const char *lim,
       cur = b + match_size;
     }
 
-  free (buf);  /* XXX */
-
   if (only_matching)
     cur = lim;
   else if (mid)

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

Summary of changes:
 doc/Makefile.am |    4 ++--
 src/main.c      |   30 +++---------------------------
 2 files changed, 5 insertions(+), 29 deletions(-)


hooks/post-receive
-- 
grep




reply via email to

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