diff options
author | Brian Fraser <fraserbn@gmail.com> | 2011-09-24 11:57:27 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-10-06 13:01:02 -0700 |
commit | 0be4d16f8f8037c260cd860eed59d47166fbdd12 (patch) | |
tree | 02f0d0e167abdfba7c280bcd7a78d10edb7f6b45 /toke.c | |
parent | bd8cb5529605f33aa9cf95d6c471386b3a0e015d (diff) | |
download | perl-0be4d16f8f8037c260cd860eed59d47166fbdd12.tar.gz |
gv.c: Initial gv_fetchpvn_flags and gv_stashpvn UTF8 cleanup
Now that a glob can be initialized and fetched in UTF-8,
the next commit will introduce some changes in toke.c to
actually test this.
Committer’s note: To keep tests passing I had to incorporate
the toke.c:S_pending_ident changes in the same patch.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -8347,7 +8347,7 @@ S_pending_ident(pTHX) HEK * const stashname = HvNAME_HEK(stash); SV * const sym = newSVhek(stashname); sv_catpvs(sym, "::"); - sv_catpvn(sym, PL_tokenbuf+1, tokenbuf_len - 1); + sv_catsv(sym, newSVpvn_flags(PL_tokenbuf+1, tokenbuf_len - 1, SVs_TEMP | (UTF ? SVf_UTF8 : 0 ))); pl_yylval.opval = (OP*)newSVOP(OP_CONST, 0, sym); pl_yylval.opval->op_private = OPpCONST_ENTERED; gv_fetchsv(sym, @@ -8391,8 +8391,8 @@ S_pending_ident(pTHX) */ if (ckWARN(WARN_AMBIGUOUS) && pit == '@' && PL_lex_state != LEX_NORMAL && !PL_lex_brackets) { - GV *const gv = gv_fetchpvn_flags(PL_tokenbuf + 1, tokenbuf_len - 1, 0, - SVt_PVAV); + GV *const gv = gv_fetchpvn_flags(PL_tokenbuf + 1, tokenbuf_len - 1, + ( UTF ? SVf_UTF8 : 0 ), SVt_PVAV); if ((!gv || ((PL_tokenbuf[0] == '@') ? !GvAV(gv) : !GvHV(gv))) /* DO NOT warn for @- and @+ */ && !( PL_tokenbuf[2] == '\0' && @@ -8407,11 +8407,13 @@ S_pending_ident(pTHX) } /* build ops for a bareword */ - pl_yylval.opval = (OP*)newSVOP(OP_CONST, 0, newSVpvn(PL_tokenbuf + 1, - tokenbuf_len - 1)); + pl_yylval.opval = (OP*)newSVOP(OP_CONST, 0, newSVpvn_flags(PL_tokenbuf + 1, + tokenbuf_len - 1, + UTF ? SVf_UTF8 : 0 )); pl_yylval.opval->op_private = OPpCONST_ENTERED; gv_fetchpvn_flags(PL_tokenbuf+1, tokenbuf_len - 1, - PL_in_eval ? (GV_ADDMULTI | GV_ADDINEVAL) : GV_ADD, + (PL_in_eval ? (GV_ADDMULTI | GV_ADDINEVAL) : GV_ADD) + | ( UTF ? SVf_UTF8 : 0 ), ((PL_tokenbuf[0] == '$') ? SVt_PV : (PL_tokenbuf[0] == '@') ? SVt_PVAV : SVt_PVHV)); |