diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-05-12 23:48:01 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-05-12 23:48:01 +0100 |
commit | 8d1c3e263ba02c52927c03abb5de6a47cf4a89f8 (patch) | |
tree | 74a3dcdb6f5064c07c61b0edd5b5532701accfe3 | |
parent | fc5be80860a82ad959a33c8cf994f241b0c6c8be (diff) | |
download | perl-8d1c3e263ba02c52927c03abb5de6a47cf4a89f8.tar.gz |
Inline S_glob_2pv() into Perl_sv_2pv_flags(). (Existing bugs included.)
Change 27942 missed this. (675c862fe1d4abfd048dce5f1958cca54b16c501)
-rw-r--r-- | embed.fnc | 1 | ||||
-rw-r--r-- | embed.h | 2 | ||||
-rw-r--r-- | proto.h | 5 | ||||
-rw-r--r-- | sv.c | 40 |
4 files changed, 17 insertions, 31 deletions
@@ -972,7 +972,6 @@ Apd |CV* |sv_2cv |NULLOK SV* sv|NN HV **const st|NN GV **const gvp \ Apd |IO* |sv_2io |NN SV *const sv #if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT) s |bool |glob_2number |NN GV* const gv -s |char* |glob_2pv |NN GV* const gv|NULLOK STRLEN * const len #endif Amb |IV |sv_2iv |NULLOK SV *sv Apd |IV |sv_2iv_flags |NULLOK SV *const sv|const I32 flags @@ -864,7 +864,6 @@ #if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT) #ifdef PERL_CORE #define glob_2number S_glob_2number -#define glob_2pv S_glob_2pv #endif #endif #define sv_2iv_flags Perl_sv_2iv_flags @@ -3201,7 +3200,6 @@ #if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT) #ifdef PERL_CORE #define glob_2number(a) S_glob_2number(aTHX_ a) -#define glob_2pv(a,b) S_glob_2pv(aTHX_ a,b) #endif #endif #define sv_2iv_flags(a,b) Perl_sv_2iv_flags(aTHX_ a,b) @@ -3012,11 +3012,6 @@ STATIC bool S_glob_2number(pTHX_ GV* const gv) #define PERL_ARGS_ASSERT_GLOB_2NUMBER \ assert(gv) -STATIC char* S_glob_2pv(pTHX_ GV* const gv, STRLEN * const len) - __attribute__nonnull__(pTHX_1); -#define PERL_ARGS_ASSERT_GLOB_2PV \ - assert(gv) - #endif /* PERL_CALLCONV IV Perl_sv_2iv(pTHX_ SV *sv); */ PERL_CALLCONV IV Perl_sv_2iv_flags(pTHX_ SV *const sv, const I32 flags); @@ -1859,27 +1859,6 @@ S_glob_2number(pTHX_ GV * const gv) return TRUE; } -STATIC char * -S_glob_2pv(pTHX_ GV * const gv, STRLEN * const len) -{ - const U32 wasfake = SvFLAGS(gv) & SVf_FAKE; - SV *const buffer = sv_newmortal(); - - PERL_ARGS_ASSERT_GLOB_2PV; - - /* FAKE globs can get coerced, so need to turn this off temporarily if it - is on. */ - SvFAKE_off(gv); - gv_efullname3(buffer, gv, "*"); - SvFLAGS(gv) |= wasfake; - - assert(SvPOK(buffer)); - if (len) { - *len = SvCUR(buffer); - } - return SvPVX(buffer); -} - /* Actually, ISO C leaves conversion of UV to IV undefined, but until proven guilty, assume that things are not that bad... */ @@ -2987,8 +2966,23 @@ Perl_sv_2pv_flags(pTHX_ register SV *const sv, STRLEN *const lp, const I32 flags #endif } else { - if (isGV_with_GP(sv)) - return glob_2pv(MUTABLE_GV(sv), lp); + if (isGV_with_GP(sv)) { + GV *const gv = MUTABLE_GV(sv); + const U32 wasfake = SvFLAGS(gv) & SVf_FAKE; + SV *const buffer = sv_newmortal(); + + /* FAKE globs can get coerced, so need to turn this off temporarily + if it is on. */ + SvFAKE_off(gv); + gv_efullname3(buffer, gv, "*"); + SvFLAGS(gv) |= wasfake; + + assert(SvPOK(buffer)); + if (lp) { + *lp = SvCUR(buffer); + } + return SvPVX(buffer); + } if (lp) *lp = 0; |