summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-05-12 23:48:01 +0100
committerNicholas Clark <nick@ccl4.org>2009-05-12 23:48:01 +0100
commit8d1c3e263ba02c52927c03abb5de6a47cf4a89f8 (patch)
tree74a3dcdb6f5064c07c61b0edd5b5532701accfe3
parentfc5be80860a82ad959a33c8cf994f241b0c6c8be (diff)
downloadperl-8d1c3e263ba02c52927c03abb5de6a47cf4a89f8.tar.gz
Inline S_glob_2pv() into Perl_sv_2pv_flags(). (Existing bugs included.)
Change 27942 missed this. (675c862fe1d4abfd048dce5f1958cca54b16c501)
-rw-r--r--embed.fnc1
-rw-r--r--embed.h2
-rw-r--r--proto.h5
-rw-r--r--sv.c40
4 files changed, 17 insertions, 31 deletions
diff --git a/embed.fnc b/embed.fnc
index 7dae7636d1..6cda6ce0c8 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -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
diff --git a/embed.h b/embed.h
index 09af299b1a..605cf2274a 100644
--- a/embed.h
+++ b/embed.h
@@ -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)
diff --git a/proto.h b/proto.h
index 520b6fae93..8e177f02d0 100644
--- a/proto.h
+++ b/proto.h
@@ -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);
diff --git a/sv.c b/sv.c
index 8c9b17abed..858ba260a9 100644
--- a/sv.c
+++ b/sv.c
@@ -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;