[pcre/f17] Possessify high ASCII

Petr Pisar ppisar at fedoraproject.org
Mon Apr 23 08:41:03 UTC 2012


commit eeffeb56506fea7b03cddb0393e05426e059a1b3
Author: Petr Písař <ppisar at redhat.com>
Date:   Mon Apr 23 09:28:31 2012 +0200

    Possessify high ASCII

 pcre-8.21-Possessify-high-ASCII.patch |  274 +++++++++++++++++++++++++++++++++
 pcre.spec                             |    8 +-
 2 files changed, 281 insertions(+), 1 deletions(-)
---
diff --git a/pcre-8.21-Possessify-high-ASCII.patch b/pcre-8.21-Possessify-high-ASCII.patch
new file mode 100644
index 0000000..377e120
--- /dev/null
+++ b/pcre-8.21-Possessify-high-ASCII.patch
@@ -0,0 +1,274 @@
+From 7dd81f4270e046af61922b1f3561277e911df3dc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Mon, 23 Apr 2012 10:19:12 +0200
+Subject: [PATCH] Possessify high ASCII
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Ported to pcre-8.21:
+
+r962 | ph10 | 2012-04-20 19:28:23 +0200 (Pá, 20 dub 2012) | 3 lines
+Fix auto-possessifying bugs when PCRE_UCP is not set, but character
+tables specify characters in the range 127-255 are letters, spaces, etc.
+---
+ pcre_compile.c        |   24 ++++----
+ testdata/testinput15  |   36 +++++++++++++
+ testdata/testoutput15 |  136 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 184 insertions(+), 12 deletions(-)
+
+diff --git a/pcre_compile.c b/pcre_compile.c
+index 77464dc..6d3ceec 100644
+--- a/pcre_compile.c
++++ b/pcre_compile.c
+@@ -2980,22 +2980,22 @@ if (next >= 0) switch(op_code)
+   When it is set, \d etc. are converted into OP_(NOT_)PROP codes. */
+ 
+   case OP_DIGIT:
+-  return next > 127 || (cd->ctypes[next] & ctype_digit) == 0;
++  return next > 255 || (cd->ctypes[next] & ctype_digit) == 0;
+ 
+   case OP_NOT_DIGIT:
+-  return next <= 127 && (cd->ctypes[next] & ctype_digit) != 0;
++  return next <= 255 && (cd->ctypes[next] & ctype_digit) != 0;
+ 
+   case OP_WHITESPACE:
+-  return next > 127 || (cd->ctypes[next] & ctype_space) == 0;
++  return next > 255 || (cd->ctypes[next] & ctype_space) == 0;
+ 
+   case OP_NOT_WHITESPACE:
+-  return next <= 127 && (cd->ctypes[next] & ctype_space) != 0;
++  return next <= 255 && (cd->ctypes[next] & ctype_space) != 0;
+ 
+   case OP_WORDCHAR:
+-  return next > 127 || (cd->ctypes[next] & ctype_word) == 0;
++  return next > 255 || (cd->ctypes[next] & ctype_word) == 0;
+ 
+   case OP_NOT_WORDCHAR:
+-  return next <= 127 && (cd->ctypes[next] & ctype_word) != 0;
++  return next <= 255 && (cd->ctypes[next] & ctype_word) != 0;
+ 
+   case OP_HSPACE:
+   case OP_NOT_HSPACE:
+@@ -3073,22 +3073,22 @@ switch(op_code)
+   switch(-next)
+     {
+     case ESC_d:
+-    return c > 127 || (cd->ctypes[c] & ctype_digit) == 0;
++    return c > 255 || (cd->ctypes[c] & ctype_digit) == 0;
+ 
+     case ESC_D:
+-    return c <= 127 && (cd->ctypes[c] & ctype_digit) != 0;
++    return c <= 255 && (cd->ctypes[c] & ctype_digit) != 0;
+ 
+     case ESC_s:
+-    return c > 127 || (cd->ctypes[c] & ctype_space) == 0;
++    return c > 255 || (cd->ctypes[c] & ctype_space) == 0;
+ 
+     case ESC_S:
+-    return c <= 127 && (cd->ctypes[c] & ctype_space) != 0;
++    return c <= 255 && (cd->ctypes[c] & ctype_space) != 0;
+ 
+     case ESC_w:
+-    return c > 127 || (cd->ctypes[c] & ctype_word) == 0;
++    return c > 255 || (cd->ctypes[c] & ctype_word) == 0;
+ 
+     case ESC_W:
+-    return c <= 127 && (cd->ctypes[c] & ctype_word) != 0;
++    return c <= 255 && (cd->ctypes[c] & ctype_word) != 0;
+ 
+     case ESC_h:
+     case ESC_H:
+diff --git a/testdata/testinput15 b/testdata/testinput15
+index d0b4cef..8355813 100644
+--- a/testdata/testinput15
++++ b/testdata/testinput15
+@@ -6,4 +6,40 @@ are different without JIT. --/
+ 
+ /a*/SI
+ 
++/\w+\x{C4}/8BZ
++    a\x{C4}\x{C4}
++
++/\w+\x{C4}/8BZT1
++    a\x{C4}\x{C4}
++    
++/\W+\x{C4}/8BZ
++    !\x{C4}
++ 
++/\W+\x{C4}/8BZT1
++    !\x{C4}
++
++/\W+\x{A1}/8BZ
++    !\x{A1}
++ 
++/\W+\x{A1}/8BZT1
++    !\x{A1}
++
++/X\s+\x{A0}/8BZ
++    X\x20\x{A0}\x{A0}
++
++/X\s+\x{A0}/8BZT1
++    X\x20\x{A0}\x{A0}
++
++/\S+\x{A0}/8BZ
++    X\x{A0}\x{A0}
++
++/\S+\x{A0}/8BZT1
++    X\x{A0}\x{A0}
++
++/\x{a0}+\s!/8BZ
++    \x{a0}\x20!
++
++/\x{a0}+\s!/8BZT1
++    \x{a0}\x20!
++
+ /-- End of testinput15 --/
+diff --git a/testdata/testoutput15 b/testdata/testoutput15
+index 10fbc54..1ff7c2e 100644
+--- a/testdata/testoutput15
++++ b/testdata/testoutput15
+@@ -18,4 +18,140 @@ No first char
+ No need char
+ Study returned NULL
+ 
++/\w+\x{C4}/8BZ
++------------------------------------------------------------------
++        Bra
++        \w++
++        \x{c4}
++        Ket
++        End
++------------------------------------------------------------------
++    a\x{C4}\x{C4}
++ 0: a\x{c4}
++
++/\w+\x{C4}/8BZT1
++------------------------------------------------------------------
++        Bra
++        \w+
++        \x{c4}
++        Ket
++        End
++------------------------------------------------------------------
++    a\x{C4}\x{C4}
++ 0: a\x{c4}\x{c4}
++    
++/\W+\x{C4}/8BZ
++------------------------------------------------------------------
++        Bra
++        \W+
++        \x{c4}
++        Ket
++        End
++------------------------------------------------------------------
++    !\x{C4}
++ 0: !\x{c4}
++ 
++/\W+\x{C4}/8BZT1
++------------------------------------------------------------------
++        Bra
++        \W++
++        \x{c4}
++        Ket
++        End
++------------------------------------------------------------------
++    !\x{C4}
++ 0: !\x{c4}
++
++/\W+\x{A1}/8BZ
++------------------------------------------------------------------
++        Bra
++        \W+
++        \x{a1}
++        Ket
++        End
++------------------------------------------------------------------
++    !\x{A1}
++ 0: !\x{a1}
++ 
++/\W+\x{A1}/8BZT1
++------------------------------------------------------------------
++        Bra
++        \W+
++        \x{a1}
++        Ket
++        End
++------------------------------------------------------------------
++    !\x{A1}
++ 0: !\x{a1}
++
++/X\s+\x{A0}/8BZ
++------------------------------------------------------------------
++        Bra
++        X
++        \s++
++        \x{a0}
++        Ket
++        End
++------------------------------------------------------------------
++    X\x20\x{A0}\x{A0}
++ 0: X \x{a0}
++
++/X\s+\x{A0}/8BZT1
++------------------------------------------------------------------
++        Bra
++        X
++        \s+
++        \x{a0}
++        Ket
++        End
++------------------------------------------------------------------
++    X\x20\x{A0}\x{A0}
++ 0: X \x{a0}\x{a0}
++
++/\S+\x{A0}/8BZ
++------------------------------------------------------------------
++        Bra
++        \S+
++        \x{a0}
++        Ket
++        End
++------------------------------------------------------------------
++    X\x{A0}\x{A0}
++ 0: X\x{a0}\x{a0}
++
++/\S+\x{A0}/8BZT1
++------------------------------------------------------------------
++        Bra
++        \S++
++        \x{a0}
++        Ket
++        End
++------------------------------------------------------------------
++    X\x{A0}\x{A0}
++ 0: X\x{a0}
++
++/\x{a0}+\s!/8BZ
++------------------------------------------------------------------
++        Bra
++        \x{a0}++
++        \s
++        !
++        Ket
++        End
++------------------------------------------------------------------
++    \x{a0}\x20!
++ 0: \x{a0} !
++
++/\x{a0}+\s!/8BZT1
++------------------------------------------------------------------
++        Bra
++        \x{a0}+
++        \s
++        !
++        Ket
++        End
++------------------------------------------------------------------
++    \x{a0}\x20!
++ 0: \x{a0} !
++
+ /-- End of testinput15 --/
+-- 
+1.7.7.6
+
diff --git a/pcre.spec b/pcre.spec
index f132763..fae8850 100644
--- a/pcre.spec
+++ b/pcre.spec
@@ -2,7 +2,7 @@
 #%%global rcversion RC1
 Name: pcre
 Version: 8.21
-Release: %{?rcversion:0.}4%{?rcversion:.%rcversion}%{?dist}
+Release: %{?rcversion:0.}5%{?rcversion:.%rcversion}%{?dist}
 %global myversion %{version}%{?rcversion:-%rcversion}
 Summary: Perl-compatible regular expression library
 Group: System Environment/Libraries
@@ -21,6 +21,8 @@ Patch3: pcre-8.21-Do-not-dereference-NULL-argument-of-pcre_free_study.patch
 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
+# bug #815217, fixed in upstream after 8.30
+Patch6: pcre-8.21-Possessify-high-ASCII.patch
 BuildRequires: readline-devel
 # New libtool to get rid of rpath
 BuildRequires: autoconf, automake, libtool
@@ -65,6 +67,7 @@ libtoolize --copy --force && autoreconf
 %patch3 -p1 -b .null_pcre_free_study
 %patch4 -p1 -b .lookbehind_assertion
 %patch5 -p0 -b .possesify_sr
+%patch6 -p1 -b .possessify_high_ascii
 # One contributor's name is non-UTF-8
 for F in ChangeLog; do
     iconv -f latin1 -t utf8 "$F" >"${F}.utf8"
@@ -135,6 +138,9 @@ make check
 %{_mandir}/man1/pcretest.*
 
 %changelog
+* Mon Apr 23 2012 Petr Pisar <ppisar at redhat.com> - 8.21-5
+- Possessify high ASCII (bug #815217)
+
 * Fri Apr 20 2012 Petr Pisar <ppisar at redhat.com> - 8.21-4
 - Possesify \s*\R (bug #813237)
 


More information about the scm-commits mailing list