summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-07-12 17:27:28 +0000
committerNicholas Clark <nick@ccl4.org>2004-07-12 17:27:28 +0000
commitd52b7888e9c3eb0ccb038b7c44075ba28e8fefa6 (patch)
tree98167a25b1563d2ec3b5a32b4c2c9ac54d35d591 /sv.c
parent7a5fa8a2cb05d06ee722842024d6960f349f483b (diff)
downloadperl-d52b7888e9c3eb0ccb038b7c44075ba28e8fefa6.tar.gz
Bodge to make Tk work - like the UTF8 flag, the READONLY flag has too
many meanings. const const vs mutable in this case. p4raw-id: //depot/perl@23085
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index aaf23e3c55..50501e7016 100644
--- 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)) {