From 3813b518ceace0cfc6d851fc55243291efcbe517 Mon Sep 17 00:00:00 2001 From: "Philip.Hazel" Date: Wed, 10 May 2017 15:42:13 +0000 Subject: [PATCH] Correct fix for experimental POSIX pattern translation. --- src/pcre2_convert.c | 7 +++++-- testdata/testinput24 | 4 ++-- testdata/testoutput24 | 8 ++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/pcre2_convert.c b/src/pcre2_convert.c index 8036ac8..c391521 100644 --- a/src/pcre2_convert.c +++ b/src/pcre2_convert.c @@ -279,12 +279,15 @@ while (plength > 0) /* Fall through */ case CHAR_ASTERISK: + case CHAR_DOT: + case CHAR_CIRCUMFLEX_ACCENT: + case CHAR_DOLLAR_SIGN: if (p + 1 > endp) return PCRE2_ERROR_NOMEMORY; *p++ = sc; break; - + default: - if (c < 256 && strchr("\\{}?*+[]()|", c) != NULL) + if (c < 256 && strchr("\\{}?*+[]()|.^$", c) != NULL) { PUTCHARS(STR_BACKSLASH); } diff --git a/testdata/testinput24 b/testdata/testinput24 index 6a22f9d..c98fd25 100644 --- a/testdata/testinput24 +++ b/testdata/testinput24 @@ -257,9 +257,9 @@ \= Expect no match a1b -/how.to/ +/how.to how\.to/ -/^how to/ +/^how to \^how to/ #pattern convert=unset diff --git a/testdata/testoutput24 b/testdata/testoutput24 index ab133d7..bd5a8d2 100644 --- a/testdata/testoutput24 +++ b/testdata/testoutput24 @@ -411,11 +411,11 @@ a*b\+c+[def]\(ab\)(cd) a1b No match -/how.to/ -how.to +/how.to how\.to/ +how.to how\.to -/^how to/ -^how to +/^how to \^how to/ +^how to \^how to #pattern convert=unset