Projects
home:FrozenHeart:branches:openEuler:24.03
my_pcre2
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:pcre2.spec
Changed
@@ -1,6 +1,6 @@ Name: pcre2 Version: 10.42 -Release: 7 +Release: 9 Summary: Perl Compatible Regular Expressions License: BSD URL: http://www.pcre.org/ @@ -29,6 +29,8 @@ Patch6018: backport-Sanity-checks-for-ctype-functions-342.patch Patch6019: backport-Fix-incorrect-class-character-matches-in-JIT.patch Patch6020: backport-Fixing-an-issue-using-empty-character-sets-in-jit.patch +Patch6021: backport-pcre2grep-document-better-possible-multiline-matchin.patch +Patch6022: backport-Remove-incorrect-optimization-in-DFA-matching-when-p.patch BuildRequires: autoconf libtool automake coreutils gcc make readline-devel Obsoletes: pcre2-utf16 pcre2-utf32 pcre2-tools @@ -146,6 +148,12 @@ %{_pkgdocdir}/html/ %changelog +* Tue Sep 03 2024 dongyuzhen <dongyuzhen@h-partners.com> - 10.42-9 +- DESC:Remove incorrect optimization in DFA matching when partial matching and (*F) are involved + +* Tue Jul 23 2024 fuanan <fuanan3@h-partners.com> - 10.42-8 +- DESC:document better possible multiline matching misses + * Tue May 07 2024 xujing <xujing125@huawei.com> - 10.42-7 - DESC:Fixing an issue using empty character sets in jit
View file
_service:tar_scm:backport-Remove-incorrect-optimization-in-DFA-matching-when-p.patch
Added
@@ -0,0 +1,118 @@ +From 674b6640e702705e8e90125f972197fae3aa364d Mon Sep 17 00:00:00 2001 +From: Philip Hazel <Philip.Hazel@gmail.com> +Date: Sat, 3 Aug 2024 17:18:56 +0100 +Subject: PATCH Remove incorrect optimization in DFA matching when partial + matching and (*F) are involved + +Conflict:don't modify ChangeLog; adapt context +Reference:https://github.com/PCRE2Project/pcre2/commit/674b6640e702705e8e90125f972197fae3aa364d + +--- + src/pcre2_dfa_match.c | 10 +--------- + testdata/testinput6 | 9 +++++++++ + testdata/testoutput6 | 13 +++++++++++++ + 3 files changed, 23 insertions(+), 9 deletions(-) + +diff --git a/src/pcre2_dfa_match.c b/src/pcre2_dfa_match.c +index 60f6b4f..1c4495f 100644 +--- a/src/pcre2_dfa_match.c ++++ b/src/pcre2_dfa_match.c +@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Original API code Copyright (c) 1997-2012 University of Cambridge +- New API code Copyright (c) 2016-2022 University of Cambridge ++ New API code Copyright (c) 2016-2024 University of Cambridge + + ----------------------------------------------------------------------------- + Redistribution and use in source and binary forms, with or without +@@ -693,7 +693,6 @@ for (;;) + int i, j; + int clen, dlen; + uint32_t c, d; +- int forced_fail = 0; + BOOL partial_newline = FALSE; + BOOL could_continue = reset_could_continue; + reset_could_continue = FALSE; +@@ -2765,7 +2764,6 @@ for (;;) + though the other "backtracking verbs" are not supported. */ + + case OP_FAIL: +- forced_fail++; /* Count FAILs for multiple states */ + break; + + case OP_ASSERT: +@@ -3247,18 +3245,12 @@ for (;;) + matches that we are going to find. If partial matching has been requested, + check for appropriate conditions. + +- The "forced_ fail" variable counts the number of (*F) encountered for the +- character. If it is equal to the original active_count (saved in +- workspace1) it means that (*F) was found on every active state. In this +- case we don't want to give a partial match. +- + The "could_continue" variable is true if a state could have continued but + for the fact that the end of the subject was reached. */ + + if (new_count <= 0) + { + if (could_continue && /* Some could go on, and */ +- forced_fail != workspace1 && /* Not all forced fail & */ + ( /* either... */ + (mb->moptions & PCRE2_PARTIAL_HARD) != 0 /* Hard partial */ + || /* or... */ +diff --git a/testdata/testinput6 b/testdata/testinput6 +index 0ca0d23..b71a69c 100644 +--- a/testdata/testinput6 ++++ b/testdata/testinput6 +@@ -4392,9 +4392,18 @@ + + /Z(*F)Q|ZXY/ + Z\=ps ++ XY\=dfa_restart + \= Expect no match + ZA\=ps + X\=ps ++ ++/Z(?:(*F)Q|XY)/ ++ Z\=ps ++ XY\=dfa_restart ++ ++/Z(*F)Q|Z(*F)XY/ ++\= Expect no match ++ Z\=ps + + /\bthe cat\b/ + the cat\=ps +diff --git a/testdata/testoutput6 b/testdata/testoutput6 +index 607b572..38c653e 100644 +--- a/testdata/testoutput6 ++++ b/testdata/testoutput6 +@@ -6769,11 +6769,24 @@ Partial match: dogs + /Z(*F)Q|ZXY/ + Z\=ps + Partial match: Z ++ XY\=dfa_restart ++ 0: XY + \= Expect no match + ZA\=ps + No match + X\=ps + No match ++ ++/Z(?:(*F)Q|XY)/ ++ Z\=ps ++Partial match: Z ++ XY\=dfa_restart ++ 0: XY ++ ++/Z(*F)Q|Z(*F)XY/ ++\= Expect no match ++ Z\=ps ++No match + + /\bthe cat\b/ + the cat\=ps +-- +2.43.0 +
View file
_service:tar_scm:backport-pcre2grep-document-better-possible-multiline-matchin.patch
Added
@@ -0,0 +1,84 @@ +From 1bc34ffa64c33381d793fb5cdddf3f484e603d23 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= <carenas@gmail.com> +Date: Fri, 12 May 2023 07:54:02 -0700 +Subject: PATCH pcre2grep: document better possible multiline matching misses + (#252) + +While at it, remove a misplaced cast that would cause problems for +subjects over 2GB and a few typos. + +Conflict:don't modify ucptest.c because ucptest.c doesn't exist in current version. +Reference:https://github.com/PCRE2Project/pcre2/commit/1bc34ffa64c33381d793fb5cdddf3f484e603d23 +--- + doc/pcre2grep.1 | 11 ++++++++--- + src/pcre2_compile.c | 4 ++-- + src/pcre2grep.c | 2 +- + 3 files changed, 11 insertions(+), 6 deletions(-) + +diff --git a/doc/pcre2grep.1 b/doc/pcre2grep.1 +index 1081591..5077304 100644 +--- a/doc/pcre2grep.1 ++++ b/doc/pcre2grep.1 +@@ -66,6 +66,9 @@ The block of memory that is actually used is three times the "buffer size", to + allow for buffering "before" and "after" lines. If the buffer size is too + small, fewer than requested "before" and "after" lines may be output. + .P ++When matching with a multiline pattern, the size of the buffer must be at least ++half of the maximum match expected or the pattern might fail to match. ++.P + Patterns can be no longer than 8KiB or BUFSIZ bytes, whichever is the greater. + BUFSIZ is defined in \fB<stdio.h>\fP. When there is more than one pattern + (specified by the use of \fB-e\fP and/or \fB-f\fP), each pattern is applied to +@@ -201,7 +204,7 @@ exactly the same as the number of lines that would have been output, but if the + \fB-M\fP (multiline) option is used (without \fB-v\fP), there may be more + suppressed lines than the count (that is, the number of matches). + .sp +-If no lines are selected, the number zero is output. If several files are are ++If no lines are selected, the number zero is output. If several files are + being scanned, a count is output for each of them and the \fB-t\fP option can + be used to cause a total to be output at the end. However, if the + \fB--files-with-matches\fP option is also used, only those files whose counts +@@ -490,8 +493,10 @@ well as possibly handling a two-character newline sequence. + .sp + There is a limit to the number of lines that can be matched, imposed by the way + that \fBpcre2grep\fP buffers the input file as it scans it. With a sufficiently +-large processing buffer, this should not be a problem, but the \fB-M\fP option +-does not work when input is read line by line (see \fB--line-buffered\fP.) ++large processing buffer, this should not be a problem. ++.sp ++The \fB-M\fP option does not work when input is read line by line (see ++\fB--line-buffered\fP.) + .TP + \fB-m\fP \fInumber\fP, \fB--max-count\fP=\fInumber\fP + Stop processing after finding \fInumber\fP matching lines, or non-matching +diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c +index b906dc0..c6d4c60 100644 +--- a/src/pcre2_compile.c ++++ b/src/pcre2_compile.c +@@ -5549,8 +5549,8 @@ for (;; pptr++) + + If the class contains characters outside the 0-255 range, a different + opcode is compiled. It may optionally have a bit map for characters < 256, +- but those above are are explicitly listed afterwards. A flag code unit +- tells whether the bitmap is present, and whether this is a negated class or ++ but those above are explicitly listed afterwards. A flag code unit tells ++ whether the bitmap is present, and whether this is a negated class or + not. */ + + case META_CLASS_NOT: +diff --git a/src/pcre2grep.c b/src/pcre2grep.c +index 1484d67..d2ab620 100644 +--- a/src/pcre2grep.c ++++ b/src/pcre2grep.c +@@ -1856,7 +1856,7 @@ if (slen > 200) + + for (int i = 1; p != NULL; p = p->next, i++) + { +- int rc = pcre2_match(p->compiled, (PCRE2_SPTR)matchptr, (int)length, ++ int rc = pcre2_match(p->compiled, (PCRE2_SPTR)matchptr, length, + startoffset, options, match_data, match_context); + if (rc == PCRE2_ERROR_NOMATCH) continue; + +-- +2.27.0 +
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2