summaryrefslogtreecommitdiff
path: root/ext/pcre/pcrelib
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>1999-05-28 20:54:52 +0000
committerAndrey Hristov <andrey@php.net>1999-05-28 20:54:52 +0000
commit3fe94e5b37a1ad8d52a79ae772d0c00018af9bdb (patch)
treeee0c60f385407fb651316453eafb4c8231119ec3 /ext/pcre/pcrelib
parent62a9f2137ccefb16e1ec56287a7baea481bfd78b (diff)
downloadphp-git-3fe94e5b37a1ad8d52a79ae772d0c00018af9bdb.tar.gz
-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)
Diffstat (limited to 'ext/pcre/pcrelib')
-rw-r--r--ext/pcre/pcrelib/pcre.c6
-rw-r--r--ext/pcre/pcrelib/pcre.h2
2 files changed, 6 insertions, 2 deletions
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 *);