Fix bad starting data for multi-case character in multi-line case insensitive UTF-8 match

This commit is contained in:
Petr Písař 2014-06-19 08:23:01 +02:00
parent dd3bcf4917
commit f241b20b12
2 changed files with 95 additions and 1 deletions

View File

@ -0,0 +1,85 @@
From 35f4457ba4dadc0839df9275adf1fd14e15c28fa Mon Sep 17 00:00:00 2001
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
Date: Wed, 18 Jun 2014 16:31:32 +0000
Subject: [PATCH] Fix bad starting data when char with more than one other case
follows circumflex in multiline UTF mode.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1485 2f5784b3-3f2a-0410-8824-cb99058d5e15
Signed-off-by: Petr Písař <ppisar@redhat.com>
Petr Pisar: Ported to 8.35.
diff --git a/pcre_compile.c b/pcre_compile.c
index 0cf05b9..29d3c29 100644
--- a/pcre_compile.c
+++ b/pcre_compile.c
@@ -4694,7 +4694,8 @@ for (;; ptr++)
previous = NULL;
if ((options & PCRE_MULTILINE) != 0)
{
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
+ if (firstcharflags == REQ_UNSET)
+ zerofirstcharflags = firstcharflags = REQ_NONE;
*code++ = OP_CIRCM;
}
else *code++ = OP_CIRC;
diff --git a/testdata/testinput6 b/testdata/testinput6
index 7a6a53f..7aebba0 100644
--- a/testdata/testinput6
+++ b/testdata/testinput6
@@ -1493,4 +1493,7 @@
/[q-u]+/8iW
Ss\x{17f}
+/^s?c/mi8
+ scat
+
/-- End of testinput6 --/
diff --git a/testdata/testinput7 b/testdata/testinput7
index 6bd0586..7a66025 100644
--- a/testdata/testinput7
+++ b/testdata/testinput7
@@ -835,4 +835,7 @@ of case for anything other than the ASCII letters. --/
/[Q-U]+/8iWBZ
+/^s?c/mi8I
+ scat
+
/-- End of testinput7 --/
diff --git a/testdata/testoutput6 b/testdata/testoutput6
index f355e60..65bf78f 100644
--- a/testdata/testoutput6
+++ b/testdata/testoutput6
@@ -2457,4 +2457,8 @@ No match
Ss\x{17f}
0: Ss\x{17f}
+/^s?c/mi8
+ scat
+ 0: sc
+
/-- End of testinput6 --/
diff --git a/testdata/testoutput7 b/testdata/testoutput7
index c64e049..ee46bdb 100644
--- a/testdata/testoutput7
+++ b/testdata/testoutput7
@@ -2287,4 +2287,12 @@ No match
End
------------------------------------------------------------------
+/^s?c/mi8I
+Capturing subpattern count = 0
+Options: caseless multiline utf
+First char at start or follows newline
+Need char = 'c' (caseless)
+ scat
+ 0: sc
+
/-- End of testinput7 --/
--
1.9.3

View File

@ -2,7 +2,7 @@
#%%global rcversion RC1
Name: pcre
Version: 8.35
Release: %{?rcversion:0.}2%{?rcversion:.%rcversion}%{?dist}.1
Release: %{?rcversion:0.}3%{?rcversion:.%rcversion}%{?dist}
%global myversion %{version}%{?rcversion:-%rcversion}
Summary: Perl-compatible regular expression library
Group: System Environment/Libraries
@ -16,6 +16,10 @@ Patch1: pcre-8.32-refused_spelling_terminated.patch
# Do no rely on wrapping signed integer while parsing {min,max} expression,
# bug #1086630, upstream bug #1463
Patch2: pcre-8.35-Do-not-rely-on-wrapping-signed-integer-while-parsein.patch
# Fix bad starting data when char with more than one other case follows
# circumflex in multiline UTF mode, bug #1110620, upstream bug #1492,
# in upstream after 8.35
Patch3: pcre-8.35-Fix-bad-starting-data-when-char-with-more-than-one-o.patch
BuildRequires: readline-devel
# New libtool to get rid of rpath
BuildRequires: autoconf, automake, libtool
@ -58,6 +62,7 @@ Utilities demonstrating PCRE capabilities like pcregrep or pcretest.
%patch0 -p1 -b .multilib
%patch1 -p1 -b .terminated_typos
%patch2 -p1 -b .gcc49
%patch3 -p1 -b .starting_data
# Because of rpath patch
libtoolize --copy --force && autoreconf -vif
# One contributor's name is non-UTF-8
@ -125,6 +130,10 @@ make %{?_smp_mflags} check
%{_mandir}/man1/pcretest.*
%changelog
* Thu Jun 19 2014 Petr Pisar <ppisar@redhat.com> - 8.35-3
- Fix bad starting data when char with more than one other case follows
circumflex in multiline UTF mode (bug #1110620)
* Fri Jun 06 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.35-2.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild