diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2014-09-15 17:15:06 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2014-09-17 20:37:48 -0700 |
commit | 8cc20c82a747460991305b0d8d72faf6830298f4 (patch) | |
tree | 1fe88ab3b7362f0ce40358e40ed3809c04a5eb4c /tests/null-byte | |
parent | 000737024019deb7b59a14f336ded508bd271352 (diff) | |
download | grep-8cc20c82a747460991305b0d8d72faf6830298f4.tar.gz |
grep: non-text bytes in binary data may be treated as line ends
* NEWS, doc/grep.texi (File and Directory Selection):
Document this change.
* src/grep.c (zap_nuls): New function.
(grep): Use it.
* tests/null-byte: Relax to allow new behavior.
Diffstat (limited to 'tests/null-byte')
-rwxr-xr-x | tests/null-byte | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/null-byte b/tests/null-byte index c967dbc9..1d80bfeb 100755 --- a/tests/null-byte +++ b/tests/null-byte @@ -38,8 +38,8 @@ for left in '' a '#' '\0'; do pat="$hat$force_regex$data$dollar" printf "$pat\\n" >pat || framework_failure_ for locale in $locales; do - LC_ALL=$locale grep -f pat in || - fail_ "'$pat' does not match '$data'" + LC_ALL=$locale grep -f pat in + test $? -eq 0 || test $? -eq 1 || fail_ "'$pat' caused an error" LC_ALL=$locale grep -a -f pat in | cmp -s - in || fail_ "-a '$pat' does not match '$data'" done |