This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [perl #41491] Incorrect regexp warning.
authorYves Orton <demerphq@gmail.com>
Thu, 15 Feb 2007 12:07:40 +0000 (13:07 +0100)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 15 Feb 2007 12:39:46 +0000 (12:39 +0000)
Message-ID: <9b18b3110702150307t21b5efd2jfdeebccdff9175b1@mail.gmail.com>

p4raw-id: //depot/perl@30313

regcomp.c

index e0a0f5c..197ab12 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -5669,7 +5669,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
     }
     else if (paren != '?')             /* Not Conditional */
        ret = br;
-    *flagp |= flags & (SPSTART | HASWIDTH);
+    *flagp |= flags & (SPSTART | HASWIDTH | POSTPONED);
     lastbr = br;
     while (*RExC_parse == '|') {
        if (!SIZE_ONLY && RExC_extralen) {
@@ -5690,9 +5690,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
            return(NULL);
         REGTAIL(pRExC_state, lastbr, br);               /* BRANCH -> BRANCH. */
        lastbr = br;
-       if (flags&HASWIDTH)
-           *flagp |= HASWIDTH;
-       *flagp |= flags&SPSTART;
+       *flagp |= flags & (SPSTART | HASWIDTH | POSTPONED);
     }
 
     if (have_branch || paren != ':') {
@@ -5833,7 +5831,7 @@ S_regbranch(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, I32 first, U32 depth)
        }
        else if (ret == NULL)
            ret = latest;
-       *flagp |= flags&HASWIDTH;
+       *flagp |= flags&(HASWIDTH|POSTPONED);
        if (chain == NULL)      /* First piece. */
            *flagp |= flags&SPSTART;
        else {