From bbc76c6a829e16cd601f08ac7a03dc1a43b87eb3 Mon Sep 17 00:00:00 2001 From: Petr Písař Date: Apr 20 2012 12:48:59 +0000 Subject: Possesify \s*\R --- diff --git a/pcre-8.30-possesify_sr.patch b/pcre-8.30-possesify_sr.patch new file mode 100644 index 0000000..7c0d8dc --- /dev/null +++ b/pcre-8.30-possesify_sr.patch @@ -0,0 +1,138 @@ +Possesify \s*\R + +This is back-ported of upstream commit for pcre-8.30: +r961 | ph10 | 2012-04-20 13:49:13 +0200 (Pá, 20 dub 2012) | 2 lines +Fix auto-possessify bugs for \s*\R and \S*R. + +Petr Pisar: Remove changelog entry + +Index: testdata/testinput2 +=================================================================== +--- testdata/testinput2 (revision 960) ++++ testdata/testinput2 (revision 961) +@@ -3102,7 +3102,25 @@ + /\d*\R/BZ + + /\s*\R/BZ ++ \x20\x0a ++ \x20\x0d ++ \x20\x0d\x0a + ++/\S*\R/BZ ++ a\x0a ++ ++/X\h*\R/BZ ++ X\x20\x0a ++ ++/X\H*\R/BZ ++ X\x0d\x0a ++ ++/X\H+\R/BZ ++ X\x0d\x0a ++ ++/X\H++\R/BZ ++ X\x0d\x0a ++ + /-- Perl treats this one differently, not failing the second string. I believe + that is a bug in Perl. --/ + +Index: testdata/testoutput2 +=================================================================== +--- testdata/testoutput2 (revision 960) ++++ testdata/testoutput2 (revision 961) +@@ -10755,12 +10755,77 @@ + /\s*\R/BZ + ------------------------------------------------------------------ + Bra +- \s*+ ++ \s* + \R + Ket + End + ------------------------------------------------------------------ ++ \x20\x0a ++ 0: \x0a ++ \x20\x0d ++ 0: \x0d ++ \x20\x0d\x0a ++ 0: \x0d\x0a + ++/\S*\R/BZ ++------------------------------------------------------------------ ++ Bra ++ \S*+ ++ \R ++ Ket ++ End ++------------------------------------------------------------------ ++ a\x0a ++ 0: a\x0a ++ ++/X\h*\R/BZ ++------------------------------------------------------------------ ++ Bra ++ X ++ \h*+ ++ \R ++ Ket ++ End ++------------------------------------------------------------------ ++ X\x20\x0a ++ 0: X \x0a ++ ++/X\H*\R/BZ ++------------------------------------------------------------------ ++ Bra ++ X ++ \H* ++ \R ++ Ket ++ End ++------------------------------------------------------------------ ++ X\x0d\x0a ++ 0: X\x0d\x0a ++ ++/X\H+\R/BZ ++------------------------------------------------------------------ ++ Bra ++ X ++ \H+ ++ \R ++ Ket ++ End ++------------------------------------------------------------------ ++ X\x0d\x0a ++ 0: X\x0d\x0a ++ ++/X\H++\R/BZ ++------------------------------------------------------------------ ++ Bra ++ X ++ \H++ ++ \R ++ Ket ++ End ++------------------------------------------------------------------ ++ X\x0d\x0a ++No match ++ + /-- Perl treats this one differently, not failing the second string. I believe + that is a bug in Perl. --/ + +Index: pcre_compile.c +=================================================================== +--- pcre_compile.c (revision 960) ++++ pcre_compile.c (revision 961) +@@ -3349,10 +3349,10 @@ + return next == -ESC_d; + + case OP_WHITESPACE: +- return next == -ESC_S || next == -ESC_d || next == -ESC_w || next == -ESC_R; ++ return next == -ESC_S || next == -ESC_d || next == -ESC_w; + + case OP_NOT_WHITESPACE: +- return next == -ESC_s || next == -ESC_h || next == -ESC_v; ++ return next == -ESC_s || next == -ESC_h || next == -ESC_v || next == -ESC_R; + + case OP_HSPACE: + return next == -ESC_S || next == -ESC_H || next == -ESC_d || diff --git a/pcre.spec b/pcre.spec index 6f27080..f132763 100644 --- a/pcre.spec +++ b/pcre.spec @@ -2,7 +2,7 @@ #%%global rcversion RC1 Name: pcre Version: 8.21 -Release: %{?rcversion:0.}3%{?rcversion:.%rcversion}%{?dist} +Release: %{?rcversion:0.}4%{?rcversion:.%rcversion}%{?dist} %global myversion %{version}%{?rcversion:-%rcversion} Summary: Perl-compatible regular expression library Group: System Environment/Libraries @@ -19,6 +19,8 @@ Patch2: pcre-8.21-Do-not-make-unmatched-subpattern-wildcard.patch Patch3: pcre-8.21-Do-not-dereference-NULL-argument-of-pcre_free_study.patch # Bug #810314, fixed in upstream after 8.30 Patch4: pcre-8.21-Fix-look-behind-assertion-in-UTF-8-JIT-mode.patch +# Bug #813237, fixed in upstream after 8.30 +Patch5: pcre-8.30-possesify_sr.patch BuildRequires: readline-devel # New libtool to get rid of rpath BuildRequires: autoconf, automake, libtool @@ -62,6 +64,7 @@ libtoolize --copy --force && autoreconf %patch2 -p1 -b .unmatched_subpattern %patch3 -p1 -b .null_pcre_free_study %patch4 -p1 -b .lookbehind_assertion +%patch5 -p0 -b .possesify_sr # One contributor's name is non-UTF-8 for F in ChangeLog; do iconv -f latin1 -t utf8 "$F" >"${F}.utf8" @@ -132,6 +135,9 @@ make check %{_mandir}/man1/pcretest.* %changelog +* Fri Apr 20 2012 Petr Pisar - 8.21-4 +- Possesify \s*\R (bug #813237) + * Thu Apr 05 2012 Petr Pisar - 8.21-3 - Fix look-behind assertion in UTF-8 JIT mode (bug #810314)