[pcre/f15] Possesify \s*\R

Petr Pisar ppisar at fedoraproject.org
Fri Apr 20 13:06:57 UTC 2012


commit 1481558b732ba714862f865e7824a2dca1065b30
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 9e855ca..56ab99f 100644
--- a/pcre.spec
+++ b/pcre.spec
@@ -1,6 +1,6 @@
 Name: pcre
 Version: 8.12
-Release: 6%{?dist}
+Release: 7%{?dist}
 Summary: Perl-compatible regular expression library
 URL: http://www.pcre.org/
 Source: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/%{name}-%{version}.tar.bz2
@@ -14,6 +14,8 @@ Patch2: pcre-8.12-forward_reference.patch
 Patch3: pcre-8.12-caseless_different_length.patch
 # Bug #769597, fixed by upstream after 8.21.
 Patch4: pcre-8.12-Do-not-make-unmatched-subpattern-wildcard.patch
+# Bug #813237, fixed in upstream after 8.30
+Patch5: pcre-8.30-possesify_sr.patch
 License: BSD
 Group: System Environment/Libraries
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
@@ -52,6 +54,7 @@ libtoolize --copy --force && autoreconf
 %patch2 -p1 -b .forward_reference
 %patch3 -p1 -b .caseless_different_length
 %patch4 -p1 -b .unmatched_subpattern
+%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"
@@ -116,6 +119,9 @@ rm -rf $RPM_BUILD_ROOT
 %doc COPYING LICENCE 
 
 %changelog
+* Fri Apr 20 2012 Petr Pisar <ppisar at redhat.com> - 8.12-7
+- Possesify \s*\R (bug #813237)
+
 * Mon Jan 02 2012 Petr Pisar <ppisar at redhat.com> - 8.12-6
 - Fix unmatched subpattern to not become wildcard (bug #769597)
 


More information about the scm-commits mailing list