summaryrefslogtreecommitdiffstats
path: root/Modules/pypcre.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-03-10 04:55:29 (GMT)
committerGuido van Rossum <guido@python.org>1998-03-10 04:55:29 (GMT)
commit816671c66641fe0b115c82a98efc5cdb693c235c (patch)
treed298272eec9e9a6baca97735fb19246e2733b2cc /Modules/pypcre.c
parent193338afeb42c591b24d74939bff1715ba4671c5 (diff)
downloadcpython-816671c66641fe0b115c82a98efc5cdb693c235c.zip
cpython-816671c66641fe0b115c82a98efc5cdb693c235c.tar.gz
cpython-816671c66641fe0b115c82a98efc5cdb693c235c.tar.bz2
patch for re.sub bug, by AMK.
Diffstat (limited to 'Modules/pypcre.c')
-rw-r--r--Modules/pypcre.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/pypcre.c b/Modules/pypcre.c
index 69d6c22..796f3b4 100644
--- a/Modules/pypcre.c
+++ b/Modules/pypcre.c
@@ -4424,7 +4424,8 @@ 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 start_pos, int options,
+ int *offsets, int offsetcount)
{
/* The "volatile" directives are to make gcc -Wall stop complaining
that these variables can be clobbered by the longjmp. Hopefully
@@ -4433,7 +4434,7 @@ int resetcount, ocount;
int first_char = -1;
match_data match_block;
const uschar *start_bits = NULL;
-const uschar *start_match = (const uschar *)subject;
+const uschar *start_match = (const uschar *)subject + start_pos;
const uschar *end_subject;
const real_pcre *re = (const real_pcre *)external_re;
const real_pcre_extra *extra = (const real_pcre_extra *)external_extra;