From 3fe94e5b37a1ad8d52a79ae772d0c00018af9bdb Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Fri, 28 May 1999 20:54:52 +0000 Subject: -Modified PCRE library slightly to do what needs to be done -Updated preg_replace() code to handle stuff properly -Removed ability to specify external PCRE library source to link against (since our bundled version is patched now) --- ext/pcre/pcrelib/pcre.c | 6 +++++- ext/pcre/pcrelib/pcre.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'ext/pcre/pcrelib') diff --git a/ext/pcre/pcrelib/pcre.c b/ext/pcre/pcrelib/pcre.c index dd5852dd31..caeeaa4971 100644 --- a/ext/pcre/pcrelib/pcre.c +++ b/ext/pcre/pcrelib/pcre.c @@ -4125,7 +4125,7 @@ Returns: > 0 => success; value is the number of elements filled in int pcre_exec(const pcre *external_re, const pcre_extra *external_extra, - const char *subject, int length, int options, int *offsets, int offsetcount) + const char *subject, int length, int options, int *offsets, int offsetcount, int minlen) { int resetcount, ocount; int first_char = -1; @@ -4287,6 +4287,10 @@ do if (!match(start_match, re->code, 2, &match_block, ims, FALSE, start_match)) continue; + /* Check that the match is not closer than minlen (Andrey Zmievski) */ + if (start_match - match_block.start_subject < minlen) + continue; + /* Copy the offset information from temporary store if necessary */ if (using_temporary_offsets) diff --git a/ext/pcre/pcrelib/pcre.h b/ext/pcre/pcrelib/pcre.h index 27204b6605..0efc0f6502 100644 --- a/ext/pcre/pcrelib/pcre.h +++ b/ext/pcre/pcrelib/pcre.h @@ -59,7 +59,7 @@ extern pcre *pcre_compile(const char *, int, const char **, int *, const unsigned char *); extern int pcre_copy_substring(const char *, int *, int, int, char *, int); extern int pcre_exec(const pcre *, const pcre_extra *, const char *, - int, int, int *, int); + int, int, int *, int, int); extern int pcre_get_substring(const char *, int *, int, int, const char **); extern int pcre_get_substring_list(const char *, int *, int, const char ***); extern int pcre_info(const pcre *, int *, int *); -- cgit v1.2.1