develooper Front page | perl.perl5.porters | Postings from February 2000

[PATCH 5.6.660] propagate UTF8 flag when sv_setsv steals PVX

From:
Gisle Aas
Date:
February 26, 2000 17:26
Subject:
[PATCH 5.6.660] propagate UTF8 flag when sv_setsv steals PVX
Message ID:
m3vh3b4fvw.fsf@eik.g.aas.no
sv_setsv() will steal the PVX from a source that have the TEMP flag
set, but it also need to carry the corresponding UTF8 flag over to the
destination SV.

Regards,
Gisle


Index: sv.c
===================================================================
RCS file: /local/perl/build/CVSROOT/perl5.6tobe2/sv.c,v
retrieving revision 1.2
diff -u -p -p -r1.2 sv.c
--- sv.c	2000/02/24 23:25:50	1.2
+++ sv.c	2000/02/27 00:55:33
@@ -2758,6 +2758,11 @@ Perl_sv_setsv(pTHX_ SV *dstr, register S
 	    SvPV_set(dstr, SvPVX(sstr));
 	    SvLEN_set(dstr, SvLEN(sstr));
 	    SvCUR_set(dstr, SvCUR(sstr));
+	    if (SvUTF8(sstr))
+		SvUTF8_on(dstr);
+	    else
+		SvUTF8_off(dstr);
+
 	    SvTEMP_off(dstr);
 	    (void)SvOK_off(sstr);
 	    SvPV_set(sstr, Nullch);



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About