[pcre/f16] Possesify \s*\R
Petr Pisar
ppisar at fedoraproject.org
Fri Apr 20 12:56:51 UTC 2012
commit 67a018f919e757ebc0ec6febdf13a72c68342c0e
Author: Petr Písař <ppisar at redhat.com>
Date: Fri Apr 20 14:42:51 2012 +0200
Possesify \s*\R
pcre-8.30-possesify_sr.patch | 138 ++++++++++++++++++++++++++++++++++++++++++
pcre.spec | 8 ++-
2 files changed, 145 insertions(+), 1 deletions(-)
---
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 d490d29..47fb965 100644
--- a/pcre.spec
+++ b/pcre.spec
@@ -1,6 +1,6 @@
Name: pcre
Version: 8.12
-Release: 7%{?dist}
+Release: 8%{?dist}
Summary: Perl-compatible regular expression library
Group: System Environment/Libraries
License: BSD
@@ -20,6 +20,8 @@ Patch4: pcre-8.12-forward_reference.patch
Patch5: pcre-8.12-caseless_different_length.patch
# Bug #769597, fixed by upstream after 8.21.
Patch6: pcre-8.12-Do-not-make-unmatched-subpattern-wildcard.patch
+# Bug #813237, fixed in upstream after 8.30
+Patch7: pcre-8.30-possesify_sr.patch
# New libtool to get rid of rpath
BuildRequires: autoconf, automake, libtool
@@ -57,6 +59,7 @@ libtoolize --copy --force && autoreconf
%patch4 -p1 -b .forward_reference
%patch5 -p1 -b .caseless_different_length
%patch6 -p1 -b .unmatched_subpattern
+%patch7 -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"
@@ -116,6 +119,9 @@ make check
%doc COPYING LICENCE
%changelog
+* Fri Apr 20 2012 Petr Pisar <ppisar at redhat.com> - 8.12-8
+- Possesify \s*\R (bug #813237)
+
* Mon Jan 02 2012 Petr Pisar <ppisar at redhat.com> - 8.12-7
- Fix unmatched subpattern to not become wildcard (bug #769597)
More information about the scm-commits
mailing list