summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2011-09-30 13:26:26 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-06 13:01:20 -0700
commit2dc9cdca3520d3d5a348f283070e7a629ff41d38 (patch)
tree6e5249def724762eabde9f09f0f3c7c39b4dd512 /op.c
parent2a33114a6710229a271f34f89dc9f2753a76b9be (diff)
downloadperl-2dc9cdca3520d3d5a348f283070e7a629ff41d38.tar.gz
op.c: Scalar filehandles in errors UTF8 cleanup.
Diffstat (limited to 'op.c')
-rw-r--r--op.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/op.c b/op.c
index c08edd06e3..3a3acb82f9 100644
--- a/op.c
+++ b/op.c
@@ -7829,6 +7829,7 @@ Perl_ck_fun(pTHX_ OP *o)
if (is_handle_constructor(o,numargs)) {
const char *name = NULL;
STRLEN len = 0;
+ U32 name_utf8 = 0;
flags = 0;
/* Set a flag to tell rv2gv to vivify
@@ -7840,6 +7841,7 @@ Perl_ck_fun(pTHX_ OP *o)
SV *const namesv
= PAD_COMPNAME_SV(kid->op_targ);
name = SvPV_const(namesv, len);
+ name_utf8 = SvUTF8(namesv);
}
else if (kid->op_type == OP_RV2SV
&& kUNOP->op_first->op_type == OP_GV)
@@ -7847,6 +7849,7 @@ Perl_ck_fun(pTHX_ OP *o)
GV * const gv = cGVOPx_gv(kUNOP->op_first);
name = GvNAME(gv);
len = GvNAMELEN(gv);
+ name_utf8 = GvNAMEUTF8(gv) ? SVf_UTF8 : 0;
}
else if (kid->op_type == OP_AELEM
|| kid->op_type == OP_HELEM)
@@ -7886,6 +7889,7 @@ Perl_ck_fun(pTHX_ OP *o)
}
if (tmpstr) {
name = SvPV_const(tmpstr, len);
+ name_utf8 = SvUTF8(tmpstr);
sv_2mortal(tmpstr);
}
}
@@ -7903,6 +7907,7 @@ Perl_ck_fun(pTHX_ OP *o)
if (*name != '$')
sv_setpvs(namesv, "$");
sv_catpvn(namesv, name, len);
+ if ( name_utf8 ) SvUTF8_on(namesv);
}
}
kid->op_sibling = 0;