Change 31377 by [EMAIL PROTECTED] on 2007/06/14 11:06:02
Fix [perl #43207] lc() or uc() inside sort affect the return value.
Affected files ...
... //depot/perl/pp.c#593 edit
... //depot/perl/t/op/lc.t#18 edit
Differences ...
==== //depot/perl/pp.c#593 (text) ====
Index: perl/pp.c
--- perl/pp.c#592~31107~ 2007-04-30 02:22:58.000000000 -0700
+++ perl/pp.c 2007-06-14 04:06:02.000000000 -0700
@@ -3522,7 +3522,7 @@
need = slen + 1;
}
- if (SvPADTMP(source) && !SvREADONLY(source) && inplace) {
+ if (SvPADTMP(source) && !SvREADONLY(source) && inplace && SvTEMP(source)) {
/* We can convert in place. */
dest = source;
@@ -3605,7 +3605,7 @@
SvGETMAGIC(source);
if (SvPADTMP(source) && !SvREADONLY(source) && !SvAMAGIC(source)
- && !DO_UTF8(source)) {
+ && SvTEMP(source) && !DO_UTF8(source)) {
/* We can convert in place. */
dest = source;
@@ -3705,7 +3705,7 @@
SvGETMAGIC(source);
if (SvPADTMP(source) && !SvREADONLY(source) && !SvAMAGIC(source)
- && !DO_UTF8(source)) {
+ && SvTEMP(source) && !DO_UTF8(source)) {
/* We can convert in place. */
dest = source;
==== //depot/perl/t/op/lc.t#18 (text) ====
Index: perl/t/op/lc.t
--- perl/t/op/lc.t#17~28028~ 2006-04-30 10:58:53.000000000 -0700
+++ perl/t/op/lc.t 2007-06-14 04:06:02.000000000 -0700
@@ -6,7 +6,7 @@
require './test.pl';
}
-plan tests => 87;
+plan tests => 88;
$a = "HELLO.* world";
$b = "hello.* WORLD";
@@ -205,3 +205,10 @@
is(lc "\x{0130}" x $_, "i\x{307}" x $_, 'lc U+0130 grows');
}
+
+# bug #43207
+my $temp = "Hello";
+for ("$temp") {
+ lc $_;
+ is($_, "Hello");
+}
End of Patch.