aboutsummaryrefslogtreecommitdiff
path: root/findutils/grep.c
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-01-19 04:30:37 +0000
committerErik Andersen <andersen@codepoet.org>2000-01-19 04:30:37 +0000
commita2f69e548587b7079e0973146895774250c3406a (patch)
tree58af08e4da017d64d6adc66c30120b07eef189ab /findutils/grep.c
parent46a4e762439eb519345703311ad314827bcd74c1 (diff)
downloadbusybox-w32-a2f69e548587b7079e0973146895774250c3406a.tar.gz
busybox-w32-a2f69e548587b7079e0973146895774250c3406a.tar.bz2
busybox-w32-a2f69e548587b7079e0973146895774250c3406a.zip
Bug fix. grep wasn't printing file names they way it was supposed to.
-Erik
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