aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorGray Wolf <wolf@wolfsden.cz>2020-04-29 15:49:17 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2020-04-29 16:01:42 +0200
commitc3295d233b6a7d924814eec9a5c5999a876daf9e (patch)
tree2281617cafa2ec0e9def7bf0ee5da3280e724c77 /testsuite
parent1c462d47a0bc92f9f57af223456df53169acf3fe (diff)
downloadbusybox-c3295d233b6a7d924814eec9a5c5999a876daf9e.tar.gz
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 <wolf@wolfsden.cz> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/grep.tests6
1 files changed, 6 insertions, 0 deletions
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" \
"" \