From 16e71ffb8a14cb831859db546ee16911ebc1f598 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Thu, 28 Apr 2022 11:40:37 -0400 Subject: add (standard input) when needed --- grep.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grep.c b/grep.c index 56e7769..71a28c2 100644 --- a/grep.c +++ b/grep.c @@ -48,6 +48,7 @@ static int grep_inverse = 0; static int grep_silent = 0; static int grep_exact = 0; +/* TODO: handle -x */ static int grep_match_re(struct grep_list *head, const char *buf) { for (struct grep_list *c = head; c != NULL; c = c->next) { @@ -111,6 +112,8 @@ static uintmax_t grep(struct grep_list *head, const char *path) } return 2; } + } else { + path = "(standard input)"; } uintmax_t found = 0; -- cgit v1.2.1