From: Hugo van der Sanden Date: Sun, 31 Jan 1999 01:50:06 +0000 (+0000) Subject: regexp flags bug X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ce3e6498997f4e021f5bd71c1348f2c333883083;p=p5sagit%2Fp5-mst-13.2.git regexp flags bug Message-Id: <199901310150.BAA16299@crypt.compulink.co.uk> p4raw-id: //depot/perl@2922 --- diff --git a/regcomp.c b/regcomp.c index 61c3e0d..5d4c0f0 100644 --- a/regcomp.c +++ b/regcomp.c @@ -1390,8 +1390,11 @@ reg(I32 paren, I32 *flagp) } /* Check for proper termination. */ - if (paren && (PL_regcomp_parse >= PL_regxend || *nextchar() != ')')) { - FAIL("unmatched () in regexp"); + if (paren) { + PL_regflags = oregflags; + if (PL_regcomp_parse >= PL_regxend || *nextchar() != ')') { + FAIL("unmatched () in regexp"); + } } else if (!paren && PL_regcomp_parse < PL_regxend) { if (*PL_regcomp_parse == ')') { @@ -1401,9 +1404,6 @@ reg(I32 paren, I32 *flagp) FAIL("junk on end of regexp"); /* "Can't happen". */ /* NOTREACHED */ } - if (paren != 0) { - PL_regflags = oregflags; - } return(ret); } diff --git a/t/op/re_tests b/t/op/re_tests index 1dca4f0..7009596 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -490,3 +490,5 @@ b\z a\nb y - - a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz x n - - a(?{$a=2;$b=3;($b)=$a})b yabz y $b 2 round\(((?>[^()]+))\) _I(round(xs * sz),1) y $1 xs * sz +'((?x:.) )' x y $1- x - +'((?-x:.) )'x x y $1- x-