From c3295d233b6a7d924814eec9a5c5999a876daf9e Mon Sep 17 00:00:00 2001 From: Gray Wolf Date: Wed, 29 Apr 2020 15:49:17 +0200 Subject: grep: Fix -f FILE when FILE is empty and -x provided Grep currently special-cased empty pattern file to be the same as pattern file with one empty line (empty pattern). That does mirror how GNU grep behaves, except when -x is provided. In that case .* pattern needs to be used instead. Signed-off-by: Gray Wolf Signed-off-by: Denys Vlasenko --- testsuite/grep.tests | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'testsuite') diff --git a/testsuite/grep.tests b/testsuite/grep.tests index 26f8e69cf..9c1f35499 100755 --- a/testsuite/grep.tests +++ b/testsuite/grep.tests @@ -129,6 +129,12 @@ testing "grep -v -f EMPTY_FILE" \ "" \ "test\n" +testing "grep -vxf EMPTY_FILE" \ + "grep -vxf input" \ + "test\n" \ + "" \ + "test\n" + testing "grep -Fw matches only words" \ "grep -Fw foo input" \ "" \ -- cgit v1.2.3