This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Pod::Man generates groff-incompatible macro definition (from
[perl5.git] / regcomp.c
index 13fa36c..7af090e 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -1732,7 +1732,9 @@ S_reg(pTHX_ I32 paren, I32 *flagp)
                *flagp = TRYAGAIN;
                return NULL;
            case 'p':
-               Perl_warner(aTHX_ WARN_REGEXP, "(?p{}) is deprecated - use (??{})");
+               if (SIZE_ONLY)
+                   Perl_warner(aTHX_ WARN_REGEXP,
+                               "(?p{}) is deprecated - use (??{})");
                /* FALL THROUGH*/
            case '?':
                logical = 1;
@@ -2294,8 +2296,14 @@ tryagain:
        nextchar();
        ret = reg(1, &flags);
        if (ret == NULL) {
-               if (flags & TRYAGAIN)
+               if (flags & TRYAGAIN) {
+                   if (PL_regcomp_parse == PL_regxend) {
+                        /* Make parent create an empty node if needed. */
+                       *flagp |= TRYAGAIN;
+                       return(NULL);
+                   }
                    goto tryagain;
+               }
                return(NULL);
        }
        *flagp |= flags&(HASWIDTH|SPSTART|SIMPLE);