Actually, only changes to regexec.c from #30081 needed to be reverted.
Rafael Garcia-Suarez [Mon, 19 Feb 2007 13:41:41 +0000 (13:41 +0000)]
p4raw-id: //depot/perl@30352

ext/re/lib/re/Tie/Hash/NamedCapture.pm
ext/re/re.pm
regcomp.c

index a76c6ab..b86463d 100644 (file)
@@ -2,6 +2,7 @@ package re::Tie::Hash::NamedCapture;
 use strict;
 use warnings;
 our $VERSION     = "0.01";
+no re 'debug';
 use re qw(is_regexp
           regname
           regnames
index 4a64af3..4f8d410 100644 (file)
@@ -138,6 +138,7 @@ sub bits {
         } elsif ($s eq 'debug' or $s eq 'debugcolor') {
            setcolor() if $s =~/color/i;
            _load_unload($on);
+           last;
         } elsif (exists $bitmask{$s}) {
            $bits |= $bitmask{$s};
        } elsif ($EXPORT_OK{$s}) {
index 6ea593e..b42cbbd 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -4710,8 +4710,9 @@ Perl_reg_named_buff_get(pTHX_ const REGEXP * const rx, SV* namesv, U32 flags)
             SV* sv_dat=HeVAL(he_str);
             I32 *nums=(I32*)SvPVX(sv_dat);
             for ( i=0; i<SvIVX(sv_dat); i++ ) {
-               if ((I32)(rx->lastparen) >= nums[i] &&
-                   rx->endp[nums[i]] != -1)
+               if ((I32)(rx->nparens) >= nums[i]
+                       && rx->startp[nums[i]] != -1
+                       && rx->endp[nums[i]] != -1)
                 {
                     ret = CALLREG_NUMBUF(rx,nums[i],NULL);
                     if (!retarray)