(retracted by 13077)
Robin Houston [Fri, 10 Aug 2001 14:42:02 +0000 (15:42 +0100)]
Subject: [PATCH] Re: [ID 20010809.028] x operator not copying elements in 'for' list?
Message-ID: <20010810144202.A32754@puffinry.freeserve.co.uk>

p4raw-id: //depot/perl@11635

pp.c

diff --git a/pp.c b/pp.c
index 1cb3a44..a051268 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -1139,8 +1139,10 @@ PP(pp_repeat)
        MEXTEND(MARK, max);
        if (count > 1) {
            while (SP > MARK) {
-               if (*SP)
-                   SvTEMP_off((*SP));
+               if (*SP) {
+                   *SP = sv_2mortal(newSVsv(*SP));
+                   SvREADONLY_on(*SP);
+               }
                SP--;
            }
            MARK++;