grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v3.3-10-g6577929


From: Paul Eggert
Subject: grep branch, master, updated. v3.3-10-g6577929
Date: Sun, 3 Feb 2019 14:47:13 -0500 (EST)

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  65779292d28dd3e57de147dc27db0a125d99b5ed (commit)
      from  1e877596ad212812b95e8dd2a7350a5799d3d7e3 (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=65779292d28dd3e57de147dc27db0a125d99b5ed


commit 65779292d28dd3e57de147dc27db0a125d99b5ed
Author: Paul Eggert <address@hidden>
Date:   Sun Feb 3 11:46:36 2019 -0800

    grep: parse --color arg independent of locale
    
    This is a better fix for Bug#34285.
    * bootstrap.conf (gnulib_modules): Add c-strcase.
    * src/grep.c: Include c-strcase.h, not strings.h.
    (main): Use c_strcasecmp, not strcasecmp.

diff --git a/bootstrap.conf b/bootstrap.conf
index ea3eddf..d453b3e 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -28,6 +28,7 @@ announce-gen
 argmatch
 c-ctype
 c-stack
+c-strcase
 closeout
 configmake
 dfa
diff --git a/src/grep.c b/src/grep.c
index fcc07b8..ef6abb8 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -25,7 +25,6 @@
 #include <inttypes.h>
 #include <stdarg.h>
 #include <stdio.h>
-#include <strings.h>
 #include "system.h"
 
 #include "argmatch.h"
@@ -47,6 +46,7 @@
 #include "quote.h"
 #include "safe-read.h"
 #include "search.h"
+#include "c-strcase.h"
 #include "version-etc.h"
 #include "xalloc.h"
 #include "xbinary-io.h"
@@ -2698,14 +2698,17 @@ main (int argc, char **argv)
       case COLOR_OPTION:
         if (optarg)
           {
-            if (!strcasecmp (optarg, "always") || !strcasecmp (optarg, "yes")
-                || !strcasecmp (optarg, "force"))
+            if (!c_strcasecmp (optarg, "always")
+                || !c_strcasecmp (optarg, "yes")
+                || !c_strcasecmp (optarg, "force"))
               color_option = 1;
-            else if (!strcasecmp (optarg, "never") || !strcasecmp (optarg, 
"no")
-                     || !strcasecmp (optarg, "none"))
+            else if (!c_strcasecmp (optarg, "never")
+                     || !c_strcasecmp (optarg, "no")
+                     || !c_strcasecmp (optarg, "none"))
               color_option = 0;
-            else if (!strcasecmp (optarg, "auto") || !strcasecmp (optarg, 
"tty")
-                     || !strcasecmp (optarg, "if-tty"))
+            else if (!c_strcasecmp (optarg, "auto")
+                     || !c_strcasecmp (optarg, "tty")
+                     || !c_strcasecmp (optarg, "if-tty"))
               color_option = 2;
             else
               show_help = 1;

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

Summary of changes:
 bootstrap.conf |  1 +
 src/grep.c     | 17 ++++++++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

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