grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.21-33-g81571c7


From: Jim Meyering
Subject: grep branch, master, updated. v2.21-33-g81571c7
Date: Fri, 26 Jun 2015 18:13:27 +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  81571c718dc064561b99e250825bd93444cec4aa (commit)
      from  f240c9477c7d76b74dbbc9390c727d49d3c7bc88 (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=81571c718dc064561b99e250825bd93444cec4aa


commit 81571c718dc064561b99e250825bd93444cec4aa
Author: Jim Meyering <address@hidden>
Date:   Mon May 11 08:07:20 2015 -0700

    maint: unify three argv-processing calls
    
    * src/grep.c (main): Unify three calls to grep_commandline_arg.

diff --git a/src/grep.c b/src/grep.c
index 4c3aa28..77ddce5 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -2589,20 +2589,27 @@ main (int argc, char **argv)
   if (fts_options & FTS_LOGICAL && devices == READ_COMMAND_LINE_DEVICES)
     devices = READ_DEVICES;
 
+  char **files;
   if (optind < argc)
     {
-      ok = true;
-      do
-        ok &= grep_command_line_arg (argv[optind]);
-      while (++optind < argc);
+      files = argv + optind;
     }
   else if (directories == RECURSE_DIRECTORIES && prepended < last_recursive)
     {
+      static char *cwd_only[] = { (char *) ".", NULL };
+      files = cwd_only;
       omit_dot_slash = true;
-      ok = grep_command_line_arg (".");
     }
   else
-    ok = grep_command_line_arg ("-");
+    {
+      static char *stdin_only[] = { (char *) "-", NULL };
+      files = stdin_only;
+    }
+
+  ok = true;
+  do
+    ok &= grep_command_line_arg (*files++);
+  while (*files != NULL);
 
   /* We register via atexit() to test stdout.  */
   exit (errseen ? EXIT_TROUBLE : ok);

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

Summary of changes:
 src/grep.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

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