From: Nicholas Clark Date: Mon, 6 Dec 2004 15:35:39 +0000 (+0000) Subject: Break out setting $^X into its own static function S_set_caret_X X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3aa90d208c3bbfc1003a792d87215a5175eaea70;p=p5sagit%2Fp5-mst-13.2.git Break out setting $^X into its own static function S_set_caret_X p4raw-id: //depot/perl@23617 --- diff --git a/perl.c b/perl.c index 4c7b45f..302faf1 100644 --- a/perl.c +++ b/perl.c @@ -4052,6 +4052,22 @@ S_procself_val(pTHX_ SV *sv, char *arg0) #endif /* HAS_PROCSELFEXE */ STATIC void +S_set_caret_X(pTHX) { + GV* tmpgv = gv_fetchpv("\030",TRUE, SVt_PV); /* $^X */ + if (tmpgv) { +#ifdef HAS_PROCSELFEXE + S_procself_val(aTHX_ GvSV(tmpgv), PL_origargv[0]); +#else +#ifdef OS2 + sv_setpv(GvSV(tmpgv), os2_execname(aTHX)); +#else + sv_setpv(GvSV(tmpgv),PL_origargv[0]); +#endif +#endif + } +} + +STATIC void S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register char **env) { char *s; @@ -4079,17 +4095,7 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register magicname("0", "0", 1); #endif } - if ((tmpgv = gv_fetchpv("\030",TRUE, SVt_PV))) {/* $^X */ -#ifdef HAS_PROCSELFEXE - S_procself_val(aTHX_ GvSV(tmpgv), PL_origargv[0]); -#else -#ifdef OS2 - sv_setpv(GvSV(tmpgv), os2_execname(aTHX)); -#else - sv_setpv(GvSV(tmpgv),PL_origargv[0]); -#endif -#endif - } + S_set_caret_X(aTHX); if ((PL_envgv = gv_fetchpv("ENV",TRUE, SVt_PVHV))) { HV *hv; GvMULTI_on(PL_envgv);