From 3fd15e197e21aa313ce56126ee814f0ebc884dee Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sat, 9 Aug 2008 16:15:14 +0000 Subject: grep: option to use GNU regex matching instead of POSIX one. This fixes problems with NULs in files being scanned, but costs +800 bytes. The same can be done to sed (TODO). --- testsuite/grep.tests | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'testsuite') diff --git a/testsuite/grep.tests b/testsuite/grep.tests index b2de2af..8cee1b9 100755 --- a/testsuite/grep.tests +++ b/testsuite/grep.tests @@ -62,12 +62,8 @@ testing "grep -s nofile - (stdin and nonexisting file, match)" \ "grep -s domatch nonexistent - ; echo \$?" \ "(standard input):domatch\n2\n" "" "nomatch\ndomatch\nend\n" -# This doesn't match GNU behaviour (Binary file input matches) -# acts like GNU grep -a -testing "grep handles binary files" "grep foo input" "foo\n" "\0foo\n\n" "" -# This doesn't match GNU behaviour (Binary file (standard input) matches) -# acts like GNU grep -a -testing "grep handles binary stdin" "grep foo" "foo\n" "" "\0foo\n\n" +testing "grep handles NUL in files" "grep -a foo input" "\0foo\n" "\0foo\n\n" "" +testing "grep handles NUL on stdin" "grep -a foo" "\0foo\n" "" "\0foo\n\n" testing "grep matches NUL" "grep . input > /dev/null 2>&1 ; echo \$?" \ "0\n" "\0\n" "" -- cgit v1.1