summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-09-13 21:07:06 +0200
committerNicholas Clark <nick@ccl4.org>2011-09-13 21:07:06 +0200
commit0f1723e1474927cd055b272619999a83bd882260 (patch)
tree972c00827a8e61fc1a2f24966d8a7f5cfad43817 /perl.c
parent2ee13fe9febdc1ee6f755724a7eaf0c7728da957 (diff)
downloadperl-0f1723e1474927cd055b272619999a83bd882260.tar.gz
In S_set_caret_X(), use GvSV() consistently in all conditional code.
Commit c69033f2a6291605 was inconsistent, in that it changed two instances of GvSV() to GvSVn(), but not the third. The expansion of GvSV() is simpler, and is appropriate here. Hoist the call to GvSV() out of the conditional code.
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl.c b/perl.c
index 45bc4ae3d9..39c555c559 100644
--- a/perl.c
+++ b/perl.c
@@ -1429,13 +1429,14 @@ S_set_caret_X(pTHX) {
dVAR;
GV* tmpgv = gv_fetchpvs("\030", GV_ADD|GV_NOTQUAL, SVt_PV); /* $^X */
if (tmpgv) {
+ SV *const caret_x = GvSV(tmpgv);
#ifdef HAS_PROCSELFEXE
- S_procself_val(aTHX_ GvSV(tmpgv), PL_origargv[0]);
+ S_procself_val(aTHX_ caret_x, PL_origargv[0]);
#else
#ifdef OS2
- sv_setpv(GvSVn(tmpgv), os2_execname(aTHX));
+ sv_setpv(caret_x, os2_execname(aTHX));
#else
- sv_setpv(GvSVn(tmpgv),PL_origargv[0]);
+ sv_setpv(caret_x, PL_origargv[0]);
#endif
#endif
}