From 8bd891cbecb41442daab3496647e09575960056d Mon Sep 17 00:00:00 2001 From: Mark Whitley Date: Wed, 28 Jun 2000 22:55:59 +0000 Subject: Added support for reading from stdin with '-' as file name arg. --- grep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grep.c') 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; -- cgit v1.2.3