summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-01-29 18:28:16 +0000
committerNicholas Clark <nick@ccl4.org>2007-01-29 18:28:16 +0000
commit29a861e74521a5f903bccb023c86950d733fa0b7 (patch)
tree30399e656738dc7add2288fa2aebd589eeaaf041 /doio.c
parente30fbb82116d47ef2569f2af20359965dc7fcae1 (diff)
downloadperl-29a861e74521a5f903bccb023c86950d733fa0b7.tar.gz
Add av_create_and_push() and av_create_and_unshift_one() to refactor
out two repeated idioms. p4raw-id: //depot/perl@30064
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/doio.c b/doio.c
index 49b1fed199..4b84bdb367 100644
--- a/doio.c
+++ b/doio.c
@@ -710,10 +710,9 @@ Perl_nextargv(pTHX_ register GV *gv)
if (io && (IoFLAGS(io) & IOf_ARGV) && (IoFLAGS(io) & IOf_START)) {
IoFLAGS(io) &= ~IOf_START;
if (PL_inplace) {
- if (!PL_argvout_stack)
- PL_argvout_stack = newAV();
assert(PL_defoutgv);
- av_push(PL_argvout_stack, SvREFCNT_inc_simple_NN(PL_defoutgv));
+ Perl_av_create_and_push(aTHX_ &PL_argvout_stack,
+ SvREFCNT_inc_simple_NN(PL_defoutgv));
}
}
if (PL_filemode & (S_ISUID|S_ISGID)) {