grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.25-96-geaa1541


From: Jim Meyering
Subject: grep branch, master, updated. v2.25-96-geaa1541
Date: Sat, 24 Sep 2016 05:09:12 +0000 (UTC)

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  eaa1541d8e714621abe5a8235f4a59cbf64b2d1f (commit)
      from  72aa3b232e847e8ab78093e87dc1ee6471d192ac (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=eaa1541d8e714621abe5a8235f4a59cbf64b2d1f


commit eaa1541d8e714621abe5a8235f4a59cbf64b2d1f
Author: Jim Meyering <address@hidden>
Date:   Fri Sep 23 20:46:19 2016 -0700

    grep: avoid unwarranted "input file 'F' is also the output" on *BSD
    
    On *BSD systems, any command like "echo y | grep x", where grep reads
    from a pipe and writes to standard output, would mistakenly emit this:
      grep: input file '(standard input)' is also the output
    * src/grep.c (grepdesc): Ensure that the file descriptor we're
    reading is a regular one before using SAME_INODE to test whether
    it is the same as the descriptor open on standard output.
    Nelson Beebe reported privately that the foad1 tests failed on many
    BSD systems.  Exposed by commit v2.25-2-gaf6af28.
    https://bugs.gnu.org/24522

diff --git a/src/grep.c b/src/grep.c
index 65916ca..3b85561 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -1819,7 +1819,7 @@ grepdesc (int desc, bool command_line)
      input==output, while there is no risk of infloop, there is a race
      condition that could result in "alternate" output.  */
   if (!out_quiet && list_files == LISTFILES_NONE && 1 < max_count
-      && SAME_INODE (st, out_stat))
+      && S_ISREG (st.st_mode) && SAME_INODE (st, out_stat))
     {
       if (! suppress_errors)
         error (0, 0, _("input file %s is also the output"), quote (filename));

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

Summary of changes:
 src/grep.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
grep



reply via email to

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