diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2014-09-11 12:05:19 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2014-09-11 12:06:56 -0700 |
commit | 2064edafdbd0e061d80e83196cbfd80a8be9cadc (patch) | |
tree | 06c39870a2b4aec63faae1a3001aa691760249bd | |
parent | a91552594dfd94469fc7b13f059bd0da9c679099 (diff) | |
download | grep-2064edafdbd0e061d80e83196cbfd80a8be9cadc.tar.gz |
grep: fix false matches with -P '...$' and invalid UTF-8
* tests/pcre-invalid-utf8-input: Add a test for that.
-rwxr-xr-x | tests/pcre-invalid-utf8-input | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/pcre-invalid-utf8-input b/tests/pcre-invalid-utf8-input index f42e0dd3..9da4b18d 100755 --- a/tests/pcre-invalid-utf8-input +++ b/tests/pcre-invalid-utf8-input @@ -13,9 +13,12 @@ require_en_utf8_locale_ fail=0 -printf 'j\202\nj\n' > in || framework_failure_ +printf 'j\202j\nj\nk\202\n' > in || framework_failure_ LC_ALL=en_US.UTF-8 grep -P j in test $? -eq 0 || fail=1 +LC_ALL=en_US.UTF-8 grep -P 'k$' in +test $? -eq 1 || fail=1 + Exit $fail |