summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1995-03-12 22:32:14 -0800
committerLarry Wall <lwall@netlabs.com>1995-03-12 22:32:14 -0800
commit748a93069b3d16374a9859d1456065dd3ae11394 (patch)
tree308ca14de9933a313dceacce8be77db67d9368c7 /regcomp.c
parentfec02dd38faf8f83471b031857d89cb76fea1ca0 (diff)
downloadperl-748a93069b3d16374a9859d1456065dd3ae11394.tar.gz
Perl 5.001perl-5.001
[See the Changes file for a list of changes]
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/regcomp.c b/regcomp.c
index 250813c204..c6f48a4487 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -268,10 +268,12 @@ PMOP* pm;
}
else /* single branch is ok */
scan = NEXTOPER(scan);
+ continue;
}
if (OP(scan) == UNLESSM) {
curback = -30000;
scan = regnext(scan);
+ continue;
}
if (OP(scan) == EXACTLY) {
char *t;
@@ -399,7 +401,7 @@ I32 *flagp;
if (paren) {
if (*regparse == '?') {
regparse++;
- paren = *nextchar();
+ paren = *regparse++;
ret = NULL;
switch (paren) {
case ':':
@@ -414,7 +416,7 @@ I32 *flagp;
while (*regparse && *regparse != ')')
regparse++;
if (*regparse != ')')
- croak("Sequence (?#... not terminated", *regparse);
+ croak("Sequence (?#... not terminated");
nextchar();
*flagp = TRYAGAIN;
return NULL;
@@ -1153,8 +1155,26 @@ nextchar()
char* retval = regparse++;
if (regflags & PMf_EXTENDED) {
- while (isSPACE(*regparse))
- regparse++;
+ for (;;) {
+ if (isSPACE(*regparse)) {
+ regparse++;
+ continue;
+ }
+ else if (*regparse == '(' && regparse[1] == '?' &&
+ regparse[2] == '#') {
+ while (*regparse && *regparse != ')')
+ regparse++;
+ regparse++;
+ continue;
+ }
+ else if (*regparse == '#') {
+ while (*regparse && *regparse != '\n')
+ regparse++;
+ regparse++;
+ continue;
+ }
+ break;
+ }
}
return retval;
}