From: Nicholas Clark Date: Mon, 12 Jul 2004 17:27:28 +0000 (+0000) Subject: Bodge to make Tk work - like the UTF8 flag, the READONLY flag has too X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d52b7888e9c3eb0ccb038b7c44075ba28e8fefa6;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/sv.c b/sv.c index aaf23e3..50501e7 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)) {