Update to version 10.42

This commit is contained in:
lingjuer 2023-07-18 18:08:56 +08:00
parent eae3e65980
commit 734bf683c8
12 changed files with 5 additions and 553 deletions

View File

@ -1,57 +0,0 @@
From 4804b00e8f50e446be43ee51863c8cdd3c743bea Mon Sep 17 00:00:00 2001
From: Philip Hazel <Philip.Hazel@gmail.com>
Date: Thu, 30 Jun 2022 17:37:51 +0100
Subject: [PATCH] Add an #ifdef to avoid the need even to link with
pcre2_jit_compile.o when JIT is not supported
Conflict:delete changelog
Reference:https://github.com/PCRE2Project/pcre2/commit/4804b00e8f50e446be43ee51863c8cdd3c743bea
---
src/pcre2_compile.c | 2 ++
src/pcre2test.c | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c
index 383159b..b906dc0 100644
--- a/src/pcre2_compile.c
+++ b/src/pcre2_compile.c
@@ -1264,8 +1264,10 @@ PCRE2_SIZE* ref_count;
if (code != NULL)
{
+#ifdef SUPPORT_JIT
if (code->executable_jit != NULL)
PRIV(jit_free)(code->executable_jit, &code->memctl);
+#endif
if ((code->flags & PCRE2_DEREF_TABLES) != 0)
{
diff --git a/src/pcre2test.c b/src/pcre2test.c
index 84987d7..11ec3ca 100644
--- a/src/pcre2test.c
+++ b/src/pcre2test.c
@@ -4737,19 +4737,19 @@ if ((pat_patctl.control & CTL_INFO) != 0)
if (pat_patctl.jit != 0 && (pat_patctl.control & CTL_JITVERIFY) != 0)
{
+#ifdef SUPPORT_JIT
if (FLD(compiled_code, executable_jit) != NULL)
fprintf(outfile, "JIT compilation was successful\n");
else
{
-#ifdef SUPPORT_JIT
fprintf(outfile, "JIT compilation was not successful");
if (jitrc != 0 && !print_error_message(jitrc, " (", ")"))
return PR_ABEND;
fprintf(outfile, "\n");
+ }
#else
fprintf(outfile, "JIT support is not available in this version of PCRE2\n");
#endif
- }
}
}
--
2.27.0

View File

@ -1,110 +0,0 @@
From 7549fdca744378b9e6597c2882a490308573368b Mon Sep 17 00:00:00 2001
From: Philip Hazel <Philip.Hazel@gmail.com>
Date: Thu, 30 Jun 2022 17:06:32 +0100
Subject: [PATCH] Change length variables in pcre2grep from int to size_t
Conflict:delete Changelog
Reference:https://github.com/PCRE2Project/pcre2/commit/7549fdca744378b9e6597c2882a490308573368b
---
src/pcre2grep.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/pcre2grep.c b/src/pcre2grep.c
index 519346b..1484d67 100644
--- a/src/pcre2grep.c
+++ b/src/pcre2grep.c
@@ -232,15 +232,16 @@ static int after_context = 0;
static int before_context = 0;
static int binary_files = BIN_BINARY;
static int both_context = 0;
-static int bufthird = PCRE2GREP_BUFSIZE;
-static int max_bufthird = PCRE2GREP_MAX_BUFSIZE;
-static int bufsize = 3*PCRE2GREP_BUFSIZE;
static int endlinetype;
static int count_limit = -1; /* Not long, so that it works with OP_NUMBER */
static unsigned long int counts_printed = 0;
static unsigned long int total_count = 0;
+static PCRE2_SIZE bufthird = PCRE2GREP_BUFSIZE;
+static PCRE2_SIZE max_bufthird = PCRE2GREP_MAX_BUFSIZE;
+static PCRE2_SIZE bufsize = 3*PCRE2GREP_BUFSIZE;
+
#ifdef WIN32
static int dee_action = dee_SKIP;
#else
@@ -433,8 +434,8 @@ static option_item optionlist[] = {
{ OP_NODATA, 'a', NULL, "text", "treat binary files as text" },
{ OP_NUMBER, 'B', &before_context, "before-context=number", "set number of prior context lines" },
{ OP_BINFILES, N_BINARY_FILES, NULL, "binary-files=word", "set treatment of binary files" },
- { OP_NUMBER, N_BUFSIZE,&bufthird, "buffer-size=number", "set processing buffer starting size" },
- { OP_NUMBER, N_MAX_BUFSIZE,&max_bufthird, "max-buffer-size=number", "set processing buffer maximum size" },
+ { OP_SIZE, N_BUFSIZE,&bufthird, "buffer-size=number", "set processing buffer starting size" },
+ { OP_SIZE, N_MAX_BUFSIZE,&max_bufthird, "max-buffer-size=number", "set processing buffer maximum size" },
{ OP_OP_STRING, N_COLOUR, &colour_option, "color=option", "matched text color option" },
{ OP_OP_STRING, N_COLOUR, &colour_option, "colour=option", "matched text colour option" },
{ OP_NUMBER, 'C', &both_context, "context=number", "set number of context lines, before & after" },
@@ -1419,10 +1420,10 @@ Returns: the number of characters read, zero at end of file
*/
static PCRE2_SIZE
-read_one_line(char *buffer, int length, FILE *f)
+read_one_line(char *buffer, PCRE2_SIZE length, FILE *f)
{
int c;
-int yield = 0;
+PCRE2_SIZE yield = 0;
while ((c = fgetc(f)) != EOF)
{
buffer[yield++] = c;
@@ -2468,8 +2469,8 @@ return result != 0;
* Read a portion of the file into buffer *
*************************************************/
-static int
-fill_buffer(void *handle, int frtype, char *buffer, int length,
+static PCRE2_SIZE
+fill_buffer(void *handle, int frtype, char *buffer, PCRE2_SIZE length,
BOOL input_line_buffered)
{
(void)frtype; /* Avoid warning when not used */
@@ -2631,7 +2632,7 @@ while (ptr < endptr)
if (bufthird < max_bufthird)
{
char *new_buffer;
- int new_bufthird = 2*bufthird;
+ PCRE2_SIZE new_bufthird = 2*bufthird;
if (new_bufthird > max_bufthird) new_bufthird = max_bufthird;
new_buffer = (char *)malloc(3*new_bufthird);
@@ -2640,7 +2641,8 @@ while (ptr < endptr)
{
fprintf(stderr,
"pcre2grep: line %lu%s%s is too long for the internal buffer\n"
- "pcre2grep: not enough memory to increase the buffer size to %d\n",
+ "pcre2grep: not enough memory to increase the buffer size to %"
+ SIZ_FORM "\n",
linenumber,
(filename == NULL)? "" : " of file ",
(filename == NULL)? "" : filename,
@@ -2670,7 +2672,7 @@ while (ptr < endptr)
{
fprintf(stderr,
"pcre2grep: line %lu%s%s is too long for the internal buffer\n"
- "pcre2grep: the maximum buffer size is %d\n"
+ "pcre2grep: the maximum buffer size is %" SIZ_FORM "\n"
"pcre2grep: use the --max-buffer-size option to change it\n",
linenumber,
(filename == NULL)? "" : " of file ",
@@ -3153,7 +3155,7 @@ while (ptr < endptr)
if (input_line_buffered && bufflength < (PCRE2_SIZE)bufsize)
{
- int add = read_one_line(ptr, bufsize - (int)(ptr - main_buffer), in);
+ PCRE2_SIZE add = read_one_line(ptr, bufsize - (ptr - main_buffer), in);
bufflength += add;
endptr += add;
}
--
2.27.0

View File

@ -1,62 +0,0 @@
From 4851890ede31313655e19180f4959ed348fee580 Mon Sep 17 00:00:00 2001
From: Zoltan Herczeg <zherczeg.u-szeged@partner.samsung.com>
Date: Thu, 14 Jul 2022 05:25:39 +0200
Subject: [PATCH] Fixed an issue in the backtracking optimization of character
repeats in JIT (#135)
Conflict:adjust changelog
Reference:https://github.com/PCRE2Project/pcre2/commit/4851890ede31313655e19180f4959ed348fee580
---
src/pcre2_jit_compile.c | 20 ++++++++++----------
src/pcre2_jit_test.c | 1 +
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c
index 8f6c090..75ba610 100644
--- a/src/pcre2_jit_compile.c
+++ b/src/pcre2_jit_compile.c
@@ -11357,19 +11357,19 @@ if (exact > 1)
}
}
else if (exact == 1)
- {
compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, TRUE);
- if (early_fail_type == type_fail_range)
- {
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr);
- OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + (int)sizeof(sljit_sw));
- OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, TMP2, 0);
- OP2(SLJIT_SUB, TMP2, 0, STR_PTR, 0, TMP2, 0);
- add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_LESS_EQUAL, TMP2, 0, TMP1, 0));
+if (early_fail_type == type_fail_range)
+ {
+ /* Range end first, followed by range start. */
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr);
+ OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + (int)sizeof(sljit_sw));
+ OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, TMP2, 0);
+ OP2(SLJIT_SUB, TMP2, 0, STR_PTR, 0, TMP2, 0);
+ add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_LESS_EQUAL, TMP2, 0, TMP1, 0));
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + (int)sizeof(sljit_sw), STR_PTR, 0);
- }
+ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0);
+ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + (int)sizeof(sljit_sw), STR_PTR, 0);
}
switch(opcode)
diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c
index f7b9f6d..e1f0bbc 100644
--- a/src/pcre2_jit_test.c
+++ b/src/pcre2_jit_test.c
@@ -354,6 +354,7 @@ static struct regression_test_case regression_test_cases[] = {
{ MU, A, 0, 0, "_[ab]+_*a", "_aa" },
{ MU, A, 0, 0, "#(A+)#\\d+", "#A#A#0" },
{ MU, A, 0, 0, "(?P<size>\\d+)m|M", "4M" },
+ { M, PCRE2_NEWLINE_CRLF, 0, 0, "\\n?.+#", "\n,\n,#" },
/* Bracket repeats with limit. */
{ MU, A, 0, 0, "(?:(ab){2}){5}M", "abababababababababababM" },
--
2.27.0

View File

@ -1,56 +0,0 @@
From 45af1203bdb5d1ccccc27526ce38c36f49196ccc Mon Sep 17 00:00:00 2001
From: larinsv <97248465+larinsv@users.noreply.github.com>
Date: Wed, 18 May 2022 13:16:00 +0300
Subject: [PATCH] Fixed race condition that occurs when initializing the
executable_allocator_is_working variable in the pcre2_jit_compile function
(#91)
Conflict:NA
Reference:https://github.com/PCRE2Project/pcre2/commit/45af1203bdb5d1ccccc27526ce38c36f49196ccc
---
src/pcre2_jit_compile.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c
index b6b1313..e638c24 100644
--- a/src/pcre2_jit_compile.c
+++ b/src/pcre2_jit_compile.c
@@ -14384,7 +14384,7 @@ pcre2_jit_compile(pcre2_code *code, uint32_t options)
pcre2_real_code *re = (pcre2_real_code *)code;
#ifdef SUPPORT_JIT
executable_functions *functions;
-static int executable_allocator_is_working = 0;
+static int executable_allocator_is_working = -1;
#endif
if (code == NULL)
@@ -14447,23 +14447,21 @@ return PCRE2_ERROR_JIT_BADOPTION;
if ((re->flags & PCRE2_NOJIT) != 0) return 0;
-if (executable_allocator_is_working == 0)
+if (executable_allocator_is_working == -1)
{
/* Checks whether the executable allocator is working. This check
might run multiple times in multi-threaded environments, but the
result should not be affected by it. */
void *ptr = SLJIT_MALLOC_EXEC(32, NULL);
-
- executable_allocator_is_working = -1;
-
if (ptr != NULL)
{
SLJIT_FREE_EXEC(((sljit_u8*)(ptr)) + SLJIT_EXEC_OFFSET(ptr), NULL);
executable_allocator_is_working = 1;
}
+ else executable_allocator_is_working = 0;
}
-if (executable_allocator_is_working < 0)
+if (!executable_allocator_is_working)
return PCRE2_ERROR_NOMEMORY;
if ((re->overall_options & PCRE2_MATCH_INVALID_UTF) != 0)
--
2.27.0

View File

@ -1,55 +0,0 @@
From b52d055d1b8feb6e56804c2062de65d50a5601e2 Mon Sep 17 00:00:00 2001
From: Philip Hazel <Philip.Hazel@gmail.com>
Date: Fri, 22 Apr 2022 18:02:14 +0100
Subject: [PATCH] Update HTML docs
Conflict:NA
Reference:https://github.com/PCRE2Project/pcre2/commit/b52d055d1b8feb6e56804c2062de65d50a5601e2
---
doc/html/pcre2_serialize_decode.html | 2 +-
doc/html/pcre2serialize.html | 2 +-
doc/pcre2.txt | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/html/pcre2_serialize_decode.html b/doc/html/pcre2_serialize_decode.html
index cff6e6c..618ffa9 100644
--- a/doc/html/pcre2_serialize_decode.html
+++ b/doc/html/pcre2_serialize_decode.html
@@ -48,7 +48,7 @@ the following negative error codes:
PCRE2_ERROR_BADDATA <i>number_of_codes</i> is zero or less
PCRE2_ERROR_BADMAGIC mismatch of id bytes in <i>bytes</i>
PCRE2_ERROR_BADMODE mismatch of variable unit size or PCRE version
- PCRE2_ERROR_MEMORY memory allocation failed
+ PCRE2_ERROR_NOMEMORY memory allocation failed
PCRE2_ERROR_NULL <i>codes</i> or <i>bytes</i> is NULL
</pre>
PCRE2_ERROR_BADMAGIC may mean that the data is corrupt, or that it was compiled
diff --git a/doc/html/pcre2serialize.html b/doc/html/pcre2serialize.html
index df4098e..a492305 100644
--- a/doc/html/pcre2serialize.html
+++ b/doc/html/pcre2serialize.html
@@ -94,7 +94,7 @@ of serialized patterns, or one of the following negative error codes:
<pre>
PCRE2_ERROR_BADDATA the number of patterns is zero or less
PCRE2_ERROR_BADMAGIC mismatch of id bytes in one of the patterns
- PCRE2_ERROR_MEMORY memory allocation failed
+ PCRE2_ERROR_NOMEMORY memory allocation failed
PCRE2_ERROR_MIXEDTABLES the patterns do not all use the same tables
PCRE2_ERROR_NULL the 1st, 3rd, or 4th argument is NULL
</pre>
diff --git a/doc/pcre2.txt b/doc/pcre2.txt
index c318432..c70fb9b 100644
--- a/doc/pcre2.txt
+++ b/doc/pcre2.txt
@@ -10436,7 +10436,7 @@ SAVING COMPILED PATTERNS
PCRE2_ERROR_BADDATA the number of patterns is zero or less
PCRE2_ERROR_BADMAGIC mismatch of id bytes in one of the patterns
- PCRE2_ERROR_MEMORY memory allocation failed
+ PCRE2_ERROR_NOMEMORY memory allocation failed
PCRE2_ERROR_MIXEDTABLES the patterns do not all use the same tables
PCRE2_ERROR_NULL the 1st, 3rd, or 4th argument is NULL
--
2.27.0

View File

@ -1,43 +0,0 @@
From a4ac97fea8a2d802985d1f5b298ede2cb07cc8cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= <carenas@gmail.com>
Date: Fri, 22 Apr 2022 09:59:44 -0700
Subject: [PATCH] doc: avoid nonexistent PCRE2_ERROR_MEMORY error (#107)
5438fc8a (Add serialization functions and tests with updated pcre2test.
Fix PCRE2_INFO_SIZE issues., 2015-01-23) introduced the typo.
Reported-by: @sjshuck
Fixes: #106
Conflict:NA
Reference:https://github.com/PCRE2Project/pcre2/commit/a4ac97fea8a2d802985d1f5b298ede2cb07cc8cd
diff --git a/doc/pcre2_serialize_decode.3 b/doc/pcre2_serialize_decode.3
index b67a112..611113f 100644
--- a/doc/pcre2_serialize_decode.3
+++ b/doc/pcre2_serialize_decode.3
@@ -36,7 +36,7 @@ the following negative error codes:
PCRE2_ERROR_BADDATA \fInumber_of_codes\fP is zero or less
PCRE2_ERROR_BADMAGIC mismatch of id bytes in \fIbytes\fP
PCRE2_ERROR_BADMODE mismatch of variable unit size or PCRE version
- PCRE2_ERROR_MEMORY memory allocation failed
+ PCRE2_ERROR_NOMEMORY memory allocation failed
PCRE2_ERROR_NULL \fIcodes\fP or \fIbytes\fP is NULL
.sp
PCRE2_ERROR_BADMAGIC may mean that the data is corrupt, or that it was compiled
diff --git a/doc/pcre2serialize.3 b/doc/pcre2serialize.3
index 987bc3a..a94f13b 100644
--- a/doc/pcre2serialize.3
+++ b/doc/pcre2serialize.3
@@ -81,7 +81,7 @@ of serialized patterns, or one of the following negative error codes:
.sp
PCRE2_ERROR_BADDATA the number of patterns is zero or less
PCRE2_ERROR_BADMAGIC mismatch of id bytes in one of the patterns
- PCRE2_ERROR_MEMORY memory allocation failed
+ PCRE2_ERROR_NOMEMORY memory allocation failed
PCRE2_ERROR_MIXEDTABLES the patterns do not all use the same tables
PCRE2_ERROR_NULL the 1st, 3rd, or 4th argument is NULL
.sp
--
2.27.0

View File

@ -1,36 +0,0 @@
From f2411acb3711a44497539d17b245bd366d9c26d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= <carenas@gmail.com>
Date: Mon, 12 Dec 2022 08:32:42 -0800
Subject: [PATCH] jit: fail early in ffcps_* if subject shorter than offs1
(#175)
FF_FUN would try loading a vector from an invalid address
triggering a crash.
Add the same check that is done in the x86/s390x implementations
and that was missing from the original code.
Fixes: #86
Conflict:NA
Reference:https://github.com/PCRE2Project/pcre2/commit/f2411acb3711a44497539d17b245bd366d9c26d7
---
src/pcre2_jit_neon_inc.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/pcre2_jit_neon_inc.h b/src/pcre2_jit_neon_inc.h
index e74adf1..165602e 100644
--- a/src/pcre2_jit_neon_inc.h
+++ b/src/pcre2_jit_neon_inc.h
@@ -183,6 +183,8 @@ restart:;
#endif
#if defined(FFCPS)
+if (str_ptr >= str_end)
+ return NULL;
sljit_u8 *p1 = str_ptr - diff;
#endif
sljit_s32 align_offset = ((uint64_t)str_ptr & 0xf);
--
1.8.3.1

View File

@ -1,39 +0,0 @@
From 7846880d63cf4b0d0d861659e222cce9c597c914 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= <carenas@gmail.com>
Date: Thu, 1 Dec 2022 01:40:01 -0800
Subject: [PATCH] jit: fix pcre2_jit_free_unused_memory() if sljit not using
allocator (#165)
sljit allows building without an internal allocator, but instead using
an external one.
make sure to only invoke the corresponding sljit call if an internal
allocator is in use (the default and as coded in pcre integration) to
avoid problems if the code is changed to use an external allocator
instead.
Conflict:NA
Reference:https://github.com/PCRE2Project/pcre2/commit/7846880d63cf4b0d0d861659e222cce9c597c914
---
src/pcre2_jit_misc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/pcre2_jit_misc.c b/src/pcre2_jit_misc.c
index e57afad..bb6a558 100644
--- a/src/pcre2_jit_misc.c
+++ b/src/pcre2_jit_misc.c
@@ -110,8 +110,10 @@ pcre2_jit_free_unused_memory(pcre2_general_context *gcontext)
(void)gcontext; /* Suppress warning */
#else /* SUPPORT_JIT */
SLJIT_UNUSED_ARG(gcontext);
+#if (defined SLJIT_EXECUTABLE_ALLOCATOR && SLJIT_EXECUTABLE_ALLOCATOR)
sljit_free_unused_memory_exec();
-#endif /* SUPPORT_JIT */
+#endif /* SLJIT_EXECUTABLE_ALLOCATOR */
+#endif /* SUPPORT_JIT */
}
--
1.8.3.1

View File

@ -1,84 +0,0 @@
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:adapt context
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
@@ -1843,7 +1843,7 @@ if (slen > 200)
for (i = 1; p != NULL; p = p->next, i++)
{
- *mrc = pcre2_match(p->compiled, (PCRE2_SPTR)matchptr, (int)length,
+ *mrc = pcre2_match(p->compiled, (PCRE2_SPTR)matchptr, length,
startoffset, options, match_data, match_context);
if (*mrc >= 0) return TRUE;
if (*mrc == PCRE2_ERROR_NOMATCH) continue;
--
2.27.0

Binary file not shown.

BIN
pcre2-10.42.tar.bz2 Normal file

Binary file not shown.

View File

@ -1,6 +1,6 @@
Name: pcre2 Name: pcre2
Version: 10.40 Version: 10.42
Release: 4 Release: 1
Summary: Perl Compatible Regular Expressions Summary: Perl Compatible Regular Expressions
License: BSD License: BSD
URL: http://www.pcre.org/ URL: http://www.pcre.org/
@ -8,15 +8,6 @@ Source0: https://github.com/PCRE2Project/pcre2/releases/download/%{name}-%{v
# Do no set RPATH if libdir is not /usr/lib # Do no set RPATH if libdir is not /usr/lib
Patch6000: backport-pcre2-10.10-Fix-multilib.patch Patch6000: backport-pcre2-10.10-Fix-multilib.patch
Patch6010: backport-doc-avoid-nonexistent-PCRE2_ERROR_MEMORY-error-107.patch
Patch6011: backport-Update-HTML-docs.patch
Patch6012: backport-Fixed-race-condition-that-occurs-when-initializing-t.patch
Patch6013: backport-Change-length-variables-in-pcre2grep-from-int-to-siz.patch
Patch6014: backport-Add-an-ifdef-to-avoid-the-need-even-to-link-with-pcr.patch
Patch6015: backport-Fixed-an-issue-in-the-backtracking-optimization-of-c.patch
Patch6016: backport-jit-fail-early-in-ffcps_-if-subject-shorter-than-off.patch
Patch6017: backport-jit-fix-pcre2_jit_free_unused_memory-if-sljit-not-us.patch
Patch6018: backport-pcre2grep-document-better-possible-multiline-matchin.patch
Patch6019: backport-no-partial-match-if-trailing-data-is-invalid-utf-238.patch Patch6019: backport-no-partial-match-if-trailing-data-is-invalid-utf-238.patch
Patch6020: backport-Fix-an-invalid-match-of-ascii-word-classes-when-inva.patch Patch6020: backport-Fix-an-invalid-match-of-ascii-word-classes-when-inva.patch
Patch6021: backport-fix-wrong-test.patch Patch6021: backport-fix-wrong-test.patch
@ -136,6 +127,9 @@ make check
%{_pkgdocdir}/html/ %{_pkgdocdir}/html/
%changelog %changelog
* Tue Jul 18 2023 zhangchenglin <zhangchenglin@kylinos.cn> - 10.42-1
- upgrade to 10.42-1
* Mon Jun 26 2023 yangmingtai <yangmingtai@huawei.com> - 10.40-4 * Mon Jun 26 2023 yangmingtai <yangmingtai@huawei.com> - 10.40-4
- DESC:sync community patches - DESC:sync community patches