sv_pvutf8n_force and sv_pvbyten_force
SADAHIRO Tomoyuki [Wed, 24 Mar 2004 00:16:52 +0000 (09:16 +0900)]
Message-Id: <20040324001126.098F.BQW10602@nifty.com>

p4raw-id: //depot/perl@22652

sv.c

diff --git a/sv.c b/sv.c
index 8e88ae2..c3a5a38 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -7835,8 +7835,10 @@ instead.
 char *
 Perl_sv_pvbyten_force(pTHX_ SV *sv, STRLEN *lp)
 {
+    sv_pvn_force(sv,lp);
     sv_utf8_downgrade(sv,0);
-    return sv_pvn_force(sv,lp);
+    *lp = SvCUR(sv);
+    return SvPVX(sv);
 }
 
 /* sv_pvutf8 () is now a macro using Perl_sv_2pv_flags();
@@ -7884,8 +7886,10 @@ instead.
 char *
 Perl_sv_pvutf8n_force(pTHX_ SV *sv, STRLEN *lp)
 {
+    sv_pvn_force(sv,lp);
     sv_utf8_upgrade(sv);
-    return sv_pvn_force(sv,lp);
+    *lp = SvCUR(sv);
+    return SvPVX(sv);
 }
 
 /*