>From 266b8d4485053a6733e11d43a66c09d080c520fa Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 11 Sep 2014 12:05:19 -0700 Subject: [PATCH] grep: fix false matches with -P '...$' and invalid UTF-8 * tests/pcre-invalid-utf8-input: Add a test for that. --- tests/pcre-invalid-utf8-input | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/pcre-invalid-utf8-input b/tests/pcre-invalid-utf8-input index f42e0dd..9da4b18 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 -- 1.9.3