From d600d3d393a05870fa0ac1102cb3f1f6eaadb3c0 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Thu, 18 Aug 2022 17:14:03 +0900 Subject: [PATCH] grep: don't print (standard input) when input is implicitly stdin --- apps/grep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/grep.c b/apps/grep.c index d7e056f1..7d9cb664 100644 --- a/apps/grep.c +++ b/apps/grep.c @@ -290,7 +290,7 @@ int main(int argc, char ** argv) { optind++; - int showFilenames = (optind + 1 != argc); + int showFilenames = (optind + 1 < argc); do { FILE * input = stdin;