summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2011-07-23 16:54:00 -0300
committerFather Chrysostomos <sprout@cpan.org>2011-10-06 13:01:03 -0700
commit6b10071b89fa167ee9dcd4aec827be0aa3200694 (patch)
treed74e82af357cd72af334f41bcaf3f66ee19e3cd7 /pp.c
parent04ec7e598cf9b8c51b752c7cbcd2ea2b582dfcbd (diff)
downloadperl-6b10071b89fa167ee9dcd4aec827be0aa3200694.tar.gz
pp.c: pp_rv2gv UTF8 cleanup.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/pp.c b/pp.c
index 48774bdab6..a288c27929 100644
--- a/pp.c
+++ b/pp.c
@@ -184,15 +184,14 @@ S_rv2gv(pTHX_ SV *sv, const bool vivify_sv, const bool strict,
if (SvREADONLY(sv))
Perl_croak_no_modify(aTHX);
if (cUNOP->op_targ) {
- STRLEN len;
SV * const namesv = PAD_SV(cUNOP->op_targ);
- const char * const name = SvPV(namesv, len);
gv = MUTABLE_GV(newSV(0));
- gv_init(gv, CopSTASH(PL_curcop), name, len, 0);
+ gv_init_sv(gv, CopSTASH(PL_curcop), namesv, 0);
}
else {
const char * const name = CopSTASHPV(PL_curcop);
- gv = newGVgen(name);
+ gv = newGVgen_flags(name,
+ HvNAMEUTF8(CopSTASH(PL_curcop)) ? SVf_UTF8 : 0 );
}
prepare_SV_for_RV(sv);
SvRV_set(sv, MUTABLE_SV(gv));