summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2002-01-13 18:06:22 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-13 17:35:48 +0000
commita84d97b6bddd35f5a52f4f41404bd0d52bf5089f (patch)
tree0bc20b4d0a0a50ee71816bd9661044279fdc8735 /regexec.c
parentf2cc0c2fb23079bf552468dc31c132970e976dd0 (diff)
downloadperl-a84d97b6bddd35f5a52f4f41404bd0d52bf5089f.tar.gz
Re: lookbehind broken with latest bleedperl
Message-Id: <200201131806.g0DI6Mp20089@crypt.compulink.co.uk> p4raw-id: //depot/perl@14240
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/regexec.c b/regexec.c
index 3380ad55f6..c3948ac338 100644
--- a/regexec.c
+++ b/regexec.c
@@ -140,13 +140,18 @@
PL_regkind[(U8)OP(rn)] == EXACT || PL_regkind[(U8)OP(rn)] == REF \
)
+/*
+ Search for mandatory following text node; for lookahead, the text must
+ follow but for lookbehind (rn->flags != 0) we skip to the next step.
+*/
#define FIND_NEXT_IMPT(rn) STMT_START { \
while (JUMPABLE(rn)) \
- if (OP(rn) == SUSPEND || OP(rn) == IFMATCH || \
- PL_regkind[(U8)OP(rn)] == CURLY) \
+ if (OP(rn) == SUSPEND || PL_regkind[(U8)OP(rn)] == CURLY) \
rn = NEXTOPER(NEXTOPER(rn)); \
else if (OP(rn) == PLUS) \
rn = NEXTOPER(rn); \
+ else if (OP(rn) == IFMATCH) \
+ rn = (rn->flags == 0) ? NEXTOPER(NEXTOPER(rn)) : rn + ARG(rn); \
else rn += NEXT_OFF(rn); \
} STMT_END