summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <dan@berrange.com>2001-08-03 12:39:33 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-08-04 17:28:55 +0000
commitf33976b4825a1f900bb28e78ad0509286ad2ffe5 (patch)
tree58019b92ac58588a5e773e4361cffd43ab20167b /regcomp.c
parent577e12cc4ababd31ea5d99718f699d57deab1b2c (diff)
downloadperl-f33976b4825a1f900bb28e78ad0509286ad2ffe5.tar.gz
Decouple SANY into SANY and CANY: the new SANY is /./s,
the new CANY is the \C. The problem reported and the test case supplied in Subject: UTF-8 bugs in string length & single line regex matches Message-ID: <20010803113932.A19318@berrange.com> p4raw-id: //depot/perl@11575
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/regcomp.c b/regcomp.c
index fb6b9c532b..9e5dcfd65b 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -2015,6 +2015,8 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
r->reganch |= ROPT_EVAL_SEEN;
if (RExC_seen & REG_SEEN_SANY)
r->reganch |= ROPT_SANY_SEEN;
+ if (RExC_seen & REG_SEEN_CANY)
+ r->reganch |= ROPT_CANY_SEEN;
Newz(1002, r->startp, RExC_npar, I32);
Newz(1002, r->endp, RExC_npar, I32);
PL_regdata = r->data; /* for regprop() */
@@ -2717,8 +2719,10 @@ tryagain:
break;
case '.':
nextchar(pRExC_state);
- if (RExC_flags16 & PMf_SINGLELINE)
+ if (RExC_flags16 & PMf_SINGLELINE) {
ret = reg_node(pRExC_state, SANY);
+ RExC_seen |= REG_SEEN_SANY;
+ }
else
ret = reg_node(pRExC_state, REG_ANY);
*flagp |= HASWIDTH|SIMPLE;
@@ -2804,8 +2808,8 @@ tryagain:
Set_Node_Length(ret, 2); /* MJD */
break;
case 'C':
- ret = reg_node(pRExC_state, SANY);
- RExC_seen |= REG_SEEN_SANY;
+ ret = reg_node(pRExC_state, CANY);
+ RExC_seen |= REG_SEEN_CANY;
*flagp |= HASWIDTH|SIMPLE;
nextchar(pRExC_state);
Set_Node_Length(ret, 2); /* MJD */