diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-01-07 12:46:07 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-01-07 12:46:07 +0000 |
commit | 7a5fd60d4ce737f71e7a689eaa2061a36dd225dc (patch) | |
tree | 183a110209d7b6c885b4a544840990eed5ece802 /mg.c | |
parent | 92ca9816760477489e51e09e0dcde1dda70f387d (diff) | |
download | perl-7a5fd60d4ce737f71e7a689eaa2061a36dd225dc.tar.gz |
Stage 1 of utf8 support for soft references.
Change gv_fetchpv to take a UTF8 flag, as gv_fetchpvn_flags
Add gv_fetchsv to look up a GV by SV rather than a char * pointer
Provide a backwards compatability gv_fetchpv
Migrate from gv_fetchpv to gv_fetchsv where the caller was grabbing
the pointer from an SV
All tests still pass.
p4raw-id: //depot/perl@23766
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -1764,16 +1764,11 @@ Perl_magic_getglob(pTHX_ SV *sv, MAGIC *mg) int Perl_magic_setglob(pTHX_ SV *sv, MAGIC *mg) { - register char *s; GV* gv; - STRLEN n_a; - + if (!SvOK(sv)) return 0; - s = SvPV(sv, n_a); - if (*s == '*' && s[1]) - s++; - gv = gv_fetchpv(s,TRUE, SVt_PVGV); + gv = gv_fetchsv(sv,TRUE, SVt_PVGV); if (sv == (SV*)gv) return 0; if (GvGP(sv)) @@ -2212,12 +2207,12 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) case '^': Safefree(IoTOP_NAME(GvIOp(PL_defoutgv))); IoTOP_NAME(GvIOp(PL_defoutgv)) = s = savepv(SvPV(sv,len)); - IoTOP_GV(GvIOp(PL_defoutgv)) = gv_fetchpv(s,TRUE, SVt_PVIO); + IoTOP_GV(GvIOp(PL_defoutgv)) = gv_fetchsv(sv,TRUE, SVt_PVIO); break; case '~': Safefree(IoFMT_NAME(GvIOp(PL_defoutgv))); IoFMT_NAME(GvIOp(PL_defoutgv)) = s = savepv(SvPV(sv,len)); - IoFMT_GV(GvIOp(PL_defoutgv)) = gv_fetchpv(s,TRUE, SVt_PVIO); + IoFMT_GV(GvIOp(PL_defoutgv)) = gv_fetchsv(sv,TRUE, SVt_PVIO); break; case '=': IoPAGE_LEN(GvIOp(PL_defoutgv)) = (SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv)); |