summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorJeff Pinyan <japhy@pobox.com>2001-09-07 05:41:10 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2001-09-07 12:43:50 +0000
commit747502373fe23827883fc1fcd05ce678523a5476 (patch)
tree0f2b43c03c32ff7658ffb639269daf845e1fb434 /regexec.c
parent5f80c4cf3be8beeeb60c4b9458c78deb8cefd57f (diff)
downloadperl-747502373fe23827883fc1fcd05ce678523a5476.tar.gz
Re: [PATCH regexec.c] more general .* and .*?
Message-ID: <Pine.GSO.4.21.0109070933530.7041-100000@crusoe.crusoe.net> p4raw-id: //depot/perl@11934
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/regexec.c b/regexec.c
index 954e905a10..7b9f1c4f67 100644
--- a/regexec.c
+++ b/regexec.c
@@ -129,12 +129,11 @@
#define LOAD_UTF8_CHARCLASS(a,b) STMT_START { if (!CAT2(PL_utf8_,a)) (void)CAT2(is_utf8_, a)((U8*)b); } STMT_END
/* for use after a quantifier and before an EXACT-like node -- japhy */
-#define NEXT_IMPT(from_rn,to_rn) STMT_START { \
- to_rn = from_rn; \
- while (PL_regkind[(U8)OP(to_rn)] == OPEN || OP(to_rn) == EVAL) \
+#define NEXT_IMPT(to_rn) STMT_START { \
+ while (OP(to_rn) == OPEN || OP(to_rn) == CLOSE || OP(to_rn) == EVAL) \
to_rn += NEXT_OFF(to_rn); \
} STMT_END
-
+
static void restore_pos(pTHX_ void *arg);
STATIC CHECKPOINT
@@ -3046,13 +3045,14 @@ S_regmatch(pTHX_ regnode *prog)
locinput = PL_reginput;
if (
PL_regkind[(U8)OP(next)] == EXACT ||
- PL_regkind[(U8)OP(next)] == OPEN ||
+ OP(next) == OPEN ||
+ OP(next) == CLOSE ||
OP(next) == EVAL
) {
regnode *text_node = next;
if (PL_regkind[(U8)OP(next)] != EXACT)
- NEXT_IMPT(next, text_node);
+ NEXT_IMPT(text_node);
if (PL_regkind[(U8)OP(text_node)] != EXACT) {
c1 = c2 = -1000;
@@ -3119,13 +3119,14 @@ S_regmatch(pTHX_ regnode *prog)
if (n >= ln) {
if (
PL_regkind[(U8)OP(next)] == EXACT ||
- PL_regkind[(U8)OP(next)] == OPEN ||
+ OP(next) == OPEN ||
+ OP(next) == CLOSE ||
OP(next) == EVAL
) {
regnode *text_node = next;
if (PL_regkind[(U8)OP(next)] != EXACT)
- NEXT_IMPT(next, text_node);
+ NEXT_IMPT(text_node);
if (PL_regkind[(U8)OP(text_node)] != EXACT) {
c1 = c2 = -1000;
@@ -3217,14 +3218,15 @@ S_regmatch(pTHX_ regnode *prog)
if (
PL_regkind[(U8)OP(next)] == EXACT ||
- PL_regkind[(U8)OP(next)] == OPEN ||
+ OP(next) == OPEN ||
+ OP(next) == CLOSE ||
OP(next) == EVAL
) {
U8 *s;
regnode *text_node = next;
if (PL_regkind[(U8)OP(next)] != EXACT)
- NEXT_IMPT(next, text_node);
+ NEXT_IMPT(text_node);
if (PL_regkind[(U8)OP(text_node)] != EXACT) {
c1 = c2 = -1000;