Change 19039 by [EMAIL PROTECTED] on 2003/03/20 22:40:38
Subject: Re: [patch] [perl #21628] rcatline issue
From: Enache Adrian <[EMAIL PROTECTED]>
Date: Thu, 20 Mar 2003 22:39:06 +0200
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/MANIFEST#994 edit
... //depot/perl/pp_hot.c#308 edit
... //depot/perl/t/op/readline.t#2 edit
Differences ...
==== //depot/perl/MANIFEST#994 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#993~19005~ Sun Mar 16 18:06:20 2003
+++ perl/MANIFEST Thu Mar 20 14:40:38 2003
@@ -2622,7 +2622,7 @@
t/op/rand.t See if rand works
t/op/range.t See if .. works
t/op/read.t See if read() works
-t/op/readline.t See if <> / readline work
+t/op/readline.t See if <> / readline / rcatline work
t/op/readdir.t See if readdir() works
t/op/recurse.t See if deep recursion works
t/op/ref.t See if refs and objects work
==== //depot/perl/pp_hot.c#308 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#307~18801~ Sun Mar 2 07:24:22 2003
+++ perl/pp_hot.c Thu Mar 20 14:40:38 2003
@@ -1494,8 +1494,10 @@
}
if (gimme == G_SCALAR) {
/* undef TARG, and push that undefined value */
- SV_CHECK_THINKFIRST_COW_DROP(TARG);
- (void)SvOK_off(TARG);
+ if (type != OP_RCATLINE) {
+ SV_CHECK_THINKFIRST_COW_DROP(TARG);
+ SvOK_off(TARG);
+ }
PUSHTARG;
}
RETURN;
@@ -1556,8 +1558,10 @@
}
}
if (gimme == G_SCALAR) {
- SV_CHECK_THINKFIRST_COW_DROP(TARG);
- (void)SvOK_off(TARG);
+ if (type != OP_RCATLINE) {
+ SV_CHECK_THINKFIRST_COW_DROP(TARG);
+ SvOK_off(TARG);
+ }
SPAGAIN;
PUSHTARG;
}
==== //depot/perl/t/op/readline.t#2 (text) ====
Index: perl/t/op/readline.t
--- perl/t/op/readline.t#1~18485~ Wed Jan 15 12:10:57 2003
+++ perl/t/op/readline.t Thu Mar 20 14:40:38 2003
@@ -6,8 +6,15 @@
require './test.pl';
}
-plan tests => 1;
+plan tests => 3;
eval { for (\2) { $_ = <FH> } };
like($@, 'Modification of a read-only value attempted', '[perl #19566]');
+{
+ open A,"+>a"; $a = 3;
+ is($a .= <A>, 3, '#21628 - $a .= <A> , A eof');
+ close A; $a = 4;
+ is($a .= <A>, 4, '#21628 - $a .= <A> , A closed');
+ unlink "a";
+}
End of Patch.