Module Name:    src
Committed By:   nakayama
Date:           Mon Jul  6 12:05:40 UTC 2015

Modified Files:
        src/usr.bin/gzip: zgrep

Log Message:
zgrep(1): suppress the prefixing of filename on output when only
one file is specified to match the grep(1)'s output.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/gzip/zgrep

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/gzip/zgrep
diff -u src/usr.bin/gzip/zgrep:1.8 src/usr.bin/gzip/zgrep:1.9
--- src/usr.bin/gzip/zgrep:1.8	Thu Jul 25 12:25:23 2013
+++ src/usr.bin/gzip/zgrep	Mon Jul  6 12:05:40 2015
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: zgrep,v 1.8 2013/07/25 12:25:23 pgoyette Exp $
+# $NetBSD: zgrep,v 1.9 2015/07/06 12:05:40 nakayama Exp $
 #
 # Copyright (c) 2003 Thomas Klausner.
 #
@@ -113,7 +113,7 @@ then
     ${zcat} -fq - | ${grep} ${grep_args} -- "${pattern}" -
 else
     # ... on all files given on the command line
-    if [ ${silent} -lt 1 ]; then
+    if [ ${silent} -lt 1 -a $# -gt 1 ]; then
 	grep_args="-H ${grep_args}"
     fi
     while [ $# -gt 0 ]

Reply via email to