aboutsummaryrefslogtreecommitdiff
path: root/findutils/grep.c
diff options
context:
space:
mode:
authorerik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-01-19 04:30:37 +0000
committererik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-01-19 04:30:37 +0000
commit2376f849c6177f5772101d5347429d45c75b5a69 (patch)
tree58af08e4da017d64d6adc66c30120b07eef189ab /findutils/grep.c
parentfa1923dc29dd9df664ff3e5df7dd9e620f471e28 (diff)
downloadbusybox-w32-2376f849c6177f5772101d5347429d45c75b5a69.tar.gz
busybox-w32-2376f849c6177f5772101d5347429d45c75b5a69.tar.bz2
busybox-w32-2376f849c6177f5772101d5347429d45c75b5a69.zip
Bug fix. grep wasn't printing file names they way it was supposed to.
-Erik git-svn-id: svn://busybox.net/trunk/busybox@316 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'findutils/grep.c')
-rw-r--r--findutils/grep.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index fdfc959af..287d9f80d 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -90,8 +90,8 @@ extern int grep_main (int argc, char **argv)
90 char *cp; 90 char *cp;
91 char *needle; 91 char *needle;
92 char *fileName; 92 char *fileName;
93 int tellName=FALSE; 93 int tellName=TRUE;
94 int ignoreCase=FALSE; 94 int ignoreCase=TRUE;
95 int tellLine=FALSE; 95 int tellLine=FALSE;
96 96
97 97
@@ -115,7 +115,7 @@ extern int grep_main (int argc, char **argv)
115 break; 115 break;
116 116
117 case 'h': 117 case 'h':
118 tellName = TRUE; 118 tellName = FALSE;
119 break; 119 break;
120 120
121 case 'n': 121 case 'n':
@@ -137,6 +137,9 @@ extern int grep_main (int argc, char **argv)
137 if (argc==0) { 137 if (argc==0) {
138 do_grep( stdin, needle, "stdin", FALSE, ignoreCase, tellLine); 138 do_grep( stdin, needle, "stdin", FALSE, ignoreCase, tellLine);
139 } else { 139 } else {
140 /* Never print the filename for just one file */
141 if (argc==1)
142 tellName=FALSE;
140 while (argc-- > 0) { 143 while (argc-- > 0) {
141 fileName = *argv++; 144 fileName = *argv++;
142 145