This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a5fa8a
)
Bodge to make Tk work - like the UTF8 flag, the READONLY flag has too
author
Nicholas Clark
<nick@ccl4.org>
Mon, 12 Jul 2004 17:27:28 +0000
(17:27 +0000)
committer
Nicholas Clark
<nick@ccl4.org>
Mon, 12 Jul 2004 17:27:28 +0000
(17:27 +0000)
many meanings. const const vs mutable in this case.
p4raw-id: //depot/perl@23085
sv.c
patch
|
blob
|
blame
|
history
diff --git
a/sv.c
b/sv.c
index
aaf23e3
..
50501e7
100644
(file)
--- a/
sv.c
+++ b/
sv.c
@@
-3941,7
+3941,13
@@
Perl_sv_utf8_upgrade_flags(pTHX_ register SV *sv, I32 flags)
return 0;
if (!SvPOK(sv)) {
STRLEN len = 0;
- (void) SvPV_force(sv,len);
+ if (SvREADONLY(sv) && (SvPOKp(sv) || SvIOKp(sv) || SvNOKp(sv))) {
+ (void) sv_2pv_flags(sv,&len, flags);
+ if (SvUTF8(sv))
+ return len;
+ } else {
+ (void) SvPV_force(sv,len);
+ }
}
if (SvUTF8(sv)) {