aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Whitley <markw@lineo.com>2000-06-28 22:55:59 +0000
committerMark Whitley <markw@lineo.com>2000-06-28 22:55:59 +0000
commit8bd891cbecb41442daab3496647e09575960056d (patch)
tree8b263d69ae55207d0fd0b7b67383da3696d0f4d7
parent1ca41775bbdc07cf67be79aebc566754c9c02855 (diff)
downloadbusybox-8bd891cbecb41442daab3496647e09575960056d.tar.gz
Added support for reading from stdin with '-' as file name arg.
-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)
/* If no files were specified, take input from stdin. Otherwise, we grep
* through all the files specified. */
- if (argv[optind+1] == NULL) {
+ if (argv[optind+1] == NULL || (strcmp(argv[optind+1], "-") == 0)) {
grep_file(stdin);
} else {
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)
/* If no files were specified, take input from stdin. Otherwise, we grep
* through all the files specified. */
- if (argv[optind+1] == NULL) {
+ if (argv[optind+1] == NULL || (strcmp(argv[optind+1], "-") == 0)) {
grep_file(stdin);
} else {
int i;