aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--findutils/grep.c2
-rw-r--r--grep.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index a374e114d..ac55f19d1 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -167,7 +167,7 @@ extern int grep_main(int argc, char **argv)
167 167
168 /* If no files were specified, take input from stdin. Otherwise, we grep 168 /* If no files were specified, take input from stdin. Otherwise, we grep
169 * through all the files specified. */ 169 * through all the files specified. */
170 if (argv[optind+1] == NULL) { 170 if (argv[optind+1] == NULL || (strcmp(argv[optind+1], "-") == 0)) {
171 grep_file(stdin); 171 grep_file(stdin);
172 } else { 172 } else {
173 int i; 173 int i;
diff --git a/grep.c b/grep.c
index a374e114d..ac55f19d1 100644
--- a/grep.c
+++ b/grep.c
@@ -167,7 +167,7 @@ extern int grep_main(int argc, char **argv)
167 167
168 /* If no files were specified, take input from stdin. Otherwise, we grep 168 /* If no files were specified, take input from stdin. Otherwise, we grep
169 * through all the files specified. */ 169 * through all the files specified. */
170 if (argv[optind+1] == NULL) { 170 if (argv[optind+1] == NULL || (strcmp(argv[optind+1], "-") == 0)) {
171 grep_file(stdin); 171 grep_file(stdin);
172 } else { 172 } else {
173 int i; 173 int i;