From 7a1c55545340734b4c7e5b94b34d2b199bf3e739 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Mon, 8 Nov 1999 04:17:28 +0000 Subject: tweak change#4502 p4raw-link: @4502 on //depot/perl: 18708f5a7334d978ddf7562cb7f58e28bec6e4ed p4raw-id: //depot/perl@4535 --- doio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'doio.c') diff --git a/doio.c b/doio.c index b340ec6577..16cff29efd 100644 --- a/doio.c +++ b/doio.c @@ -490,8 +490,11 @@ Perl_nextargv(pTHX_ register GV *gv) PL_argvoutgv = gv_fetchpv("ARGVOUT",TRUE,SVt_PVIO); if (io && (IoFLAGS(io) & IOf_ARGV) && (IoFLAGS(io) & IOf_START)) { IoFLAGS(io) &= ~IOf_START; - if (PL_inplace) + if (PL_inplace) { + if (!PL_argvout_stack) + PL_argvout_stack = newAV(); av_push(PL_argvout_stack, SvREFCNT_inc(PL_defoutgv)); + } } if (PL_filemode & (S_ISUID|S_ISGID)) { PerlIO_flush(IoIFP(GvIOn(PL_argvoutgv))); /* chmod must follow last write */ @@ -668,7 +671,9 @@ Perl_nextargv(pTHX_ register GV *gv) IoFLAGS(io) |= IOf_START; if (PL_inplace) { (void)do_close(PL_argvoutgv,FALSE); - if (io && (IoFLAGS(io) & IOf_ARGV) && AvFILLp(PL_argvout_stack) >= 0) { + if (io && (IoFLAGS(io) & IOf_ARGV) + && PL_argvout_stack && AvFILLp(PL_argvout_stack) >= 0) + { GV *oldout = (GV*)av_pop(PL_argvout_stack); setdefout(oldout); SvREFCNT_dec(oldout); -- cgit v1.2.1 From 350de78d9c02710bb008e9ca922c78ba251ec366 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Mon, 8 Nov 1999 18:50:40 +0000 Subject: preliminary support for GVOP indirection via pad p4raw-id: //depot/perl@4539 --- doio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doio.c') diff --git a/doio.c b/doio.c index 16cff29efd..02d74b9ae8 100644 --- a/doio.c +++ b/doio.c @@ -1064,7 +1064,7 @@ Perl_my_stat(pTHX) if (PL_op->op_flags & OPf_REF) { EXTEND(SP,1); - tmpgv = (GV*)cSVOP->op_sv; + tmpgv = cGVOP; do_fstat: io = GvIO(tmpgv); if (io && IoIFP(io)) { @@ -1117,7 +1117,7 @@ Perl_my_lstat(pTHX) STRLEN n_a; if (PL_op->op_flags & OPf_REF) { EXTEND(SP,1); - if ((GV*)cSVOP->op_sv == PL_defgv) { + if (cGVOP == PL_defgv) { if (PL_laststype != OP_LSTAT) Perl_croak(aTHX_ "The stat preceding -l _ wasn't an lstat"); return PL_laststatval; -- cgit v1.2.1