summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2022-04-28 11:40:37 -0400
committerJakob Kaivo <jkk@ung.org>2022-04-28 11:40:37 -0400
commit16e71ffb8a14cb831859db546ee16911ebc1f598 (patch)
treec0a39b0cfae77942e1aeb0a13ce26644d868b0ea
parentb7b37e986c7e4ca819f9cbbf683033f149f74e4b (diff)
add (standard input) when needed
-rw-r--r--grep.c3
1 files changed, 3 insertions, 0 deletions
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;