mirror of
https://git.busybox.net/busybox
synced 2026-02-07 20:50:26 +00:00
Added support for reading from stdin with '-' as file name arg.
This commit is contained in:
parent
1ca41775bb
commit
8bd891cbec
2 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
2
grep.c
2
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue