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  2390067340d41aac6ed32f2faaec8b94d09f03e0 (commit)
      from  cb3fb19a4bf5e07cc0813e1fca7ae20e51e90206 (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=2390067340d41aac6ed32f2faaec8b94d09f03e0


commit 2390067340d41aac6ed32f2faaec8b94d09f03e0
Author: Jim Meyering <[email protected]>
Date:   Thu Apr 1 16:16:10 2010 +0200

    maint: avoid unnecessary 2nd getenv("TERM")
    
    * src/main.c (main): Don't call getenv("TERM") twice -- in the same
    expression, even.

diff --git a/src/main.c b/src/main.c
index 0bb4098..1697c80 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2010,13 +2010,15 @@ main (int argc, char **argv)
             show_help = 1;
         } else
           color_option = 2;
-        if(color_option == 2) {
-          if(isatty(STDOUT_FILENO) && getenv("TERM") &&
-            strcmp(getenv("TERM"), "dumb"))
-                  color_option = 1;
-          else
-            color_option = 0;
-        }
+        if (color_option == 2)
+         {
+           char const *t;
+           if (isatty (STDOUT_FILENO) && (t = getenv ("TERM"))
+               && strcmp (t, "dumb"))
+             color_option = 1;
+           else
+             color_option = 0;
+         }
        break;
 
       case EXCLUDE_OPTION:

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

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


hooks/post-receive
-- 
grep


Reply via email to