From 4608e0956430334998e6d2468c499b1ca1e6fddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 19 Oct 2016 11:02:54 +0200 Subject: [PATCH] Fix displaying a callout position in pcretest output with an escape sequence greater than \x{ff} --- ...Fix-callout-display-bug-in-pcre2test.patch | 74 +++++++++++++++++++ pcre2.spec | 10 ++- 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 pcre2-10.22-Fix-callout-display-bug-in-pcre2test.patch diff --git a/pcre2-10.22-Fix-callout-display-bug-in-pcre2test.patch b/pcre2-10.22-Fix-callout-display-bug-in-pcre2test.patch new file mode 100644 index 0000000..26b5d11 --- /dev/null +++ b/pcre2-10.22-Fix-callout-display-bug-in-pcre2test.patch @@ -0,0 +1,74 @@ +From 3caf27da49d315b53783af8e602f6be09b435bc2 Mon Sep 17 00:00:00 2001 +From: ph10 +Date: Wed, 5 Oct 2016 16:53:34 +0000 +Subject: [PATCH] Fix callout display bug in pcre2test. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@557 6239d852-aaf2-0410-a92c-79f79f948069 + +Petr Písař: Ported to 10.22. + +Signed-off-by: Petr Písař +--- + src/pcre2test.c | 4 ++++ + testdata/testinput5 | 3 +++ + testdata/testoutput5 | 9 +++++++++ + 3 files changed, 16 insertions(+) + +diff --git a/src/pcre2test.c b/src/pcre2test.c +index a8dffa3..96520e8 100644 +--- a/src/pcre2test.c ++++ b/src/pcre2test.c +@@ -2525,6 +2525,8 @@ static int + pchar(uint32_t c, BOOL utf, FILE *f) + { + int n = 0; ++char tempbuffer[16]; ++ + if (PRINTOK(c)) + { + if (f != NULL) fprintf(f, "%c", c); +@@ -2546,6 +2548,8 @@ if (c < 0x100) + } + + if (f != NULL) n = fprintf(f, "\\x{%02x}", c); ++ else n = sprintf(tempbuffer, "\\x{%02x}", c); ++ + return n >= 0 ? n : 0; + } + +diff --git a/testdata/testinput5 b/testdata/testinput5 +index 1f44ceb..461302a 100644 +--- a/testdata/testinput5 ++++ b/testdata/testinput5 +@@ -1724,4 +1724,7 @@ + \= Expect no match + \x{10000} + ++/../utf,auto_callout ++ \n\x{123}\x{123}\x{123}\x{123} ++ + # End of testinput5 +diff --git a/testdata/testoutput5 b/testdata/testoutput5 +index b670677..e661033 100644 +--- a/testdata/testoutput5 ++++ b/testdata/testoutput5 +@@ -4160,4 +4160,13 @@ No match + \x{10000} + No match + ++/../utf,auto_callout ++ \n\x{123}\x{123}\x{123}\x{123} ++--->\x{0a}\x{123}\x{123}\x{123}\x{123} ++ +0 ^ . ++ +0 ^ . ++ +1 ^ ^ . ++ +2 ^ ^ ++ 0: \x{123}\x{123} ++ + # End of testinput5 +-- +2.7.4 + diff --git a/pcre2.spec b/pcre2.spec index 981a281..cc08acb 100644 --- a/pcre2.spec +++ b/pcre2.spec @@ -2,7 +2,7 @@ #%%global rcversion RC1 Name: pcre2 Version: 10.22 -Release: %{?rcversion:0.}2%{?rcversion:.%rcversion}%{?dist} +Release: %{?rcversion:0.}3%{?rcversion:.%rcversion}%{?dist} %global myversion %{version}%{?rcversion:-%rcversion} Summary: Perl-compatible regular expression library Group: System Environment/Libraries @@ -27,6 +27,9 @@ Patch0: pcre2-10.10-Fix-multilib.patch # without enabled UCP in a positive class, in upstream after 10.22, # upstream bug #1866 Patch1: pcre2-10.22-Fix-bug-that-caused-chars-255-not-to-be-matched-by-c.patch +# Fix displaying a callout position in pcretest output with an escape sequence +# greater than \x{ff}, in upstream after 10.22 +Patch2: pcre2-10.22-Fix-callout-display-bug-in-pcre2test.patch # New libtool to get rid of RPATH and to use distribution autotools BuildRequires: autoconf BuildRequires: automake @@ -105,6 +108,7 @@ Utilities demonstrating PCRE2 capabilities like pcre2grep or pcre2test. %setup -q -n %{name}-%{myversion} %patch0 -p1 %patch1 -p1 +%patch2 -p1 # Because of multilib patch libtoolize --copy --force autoreconf -vif @@ -201,6 +205,10 @@ make %{?_smp_mflags} check VERBOSE=yes %{_mandir}/man1/pcre2test.* %changelog +* Wed Oct 19 2016 Petr Pisar - 10.22-3 +- Fix displaying a callout position in pcretest output with an escape sequence + greater than \x{ff} + * Mon Aug 29 2016 Petr Pisar - 10.22-2 - Fix matching characters above 255 when a negative character type was used without enabled UCP in a positive class (upstream bug #1866)