diff options
author | Ilya Zakharevich <ilya@math.ohio-state.edu> | 1996-02-04 16:34:29 -0500 |
---|---|---|
committer | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1996-02-04 16:34:29 -0500 |
commit | 1193dd27ade65d48ff9917d545f844f2c8e15493 (patch) | |
tree | b8ca2607e239309229293e6e6eb9ee82bfac7643 /doio.c | |
parent | f87d5507fb010a3884966d0988c92a49078b389e (diff) | |
download | perl-1193dd27ade65d48ff9917d545f844f2c8e15493.tar.gz |
Inplace editing broken if DOSISH
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 31 |
1 files changed, 21 insertions, 10 deletions
@@ -407,7 +407,7 @@ register GV *gv; do_close(gv,FALSE); (void)unlink(SvPVX(sv)); (void)rename(oldname,SvPVX(sv)); - do_open(gv,SvPVX(sv),SvCUR(GvSV(gv)),FALSE,0,0,Nullfp); + do_open(gv,SvPVX(sv),SvCUR(sv),FALSE,0,0,Nullfp); #endif /* MSDOS */ #else (void)UNLINK(SvPVX(sv)); @@ -529,9 +529,8 @@ bool explicit; do_close(GV *gv, bool explicit) #endif /* CAN_PROTOTYPE */ { - bool retval = FALSE; - register IO *io; - int status; + bool retval; + IO *io; if (!gv) gv = argvgv; @@ -545,6 +544,23 @@ do_close(GV *gv, bool explicit) warn("Close on unopened file <%s>",GvENAME(gv)); return FALSE; } + retval = io_close(io); + if (explicit) { + IoLINES(io) = 0; + IoPAGE(io) = 0; + IoLINES_LEFT(io) = IoPAGE_LEN(io); + } + IoTYPE(io) = ' '; + return retval; +} + +bool +io_close(io) +IO* io; +{ + bool retval = FALSE; + int status; + if (IoIFP(io)) { if (IoTYPE(io) == '|') { status = my_pclose(IoIFP(io)); @@ -563,12 +579,7 @@ do_close(GV *gv, bool explicit) } IoOFP(io) = IoIFP(io) = Nullfp; } - if (explicit) { - IoLINES(io) = 0; - IoPAGE(io) = 0; - IoLINES_LEFT(io) = IoPAGE_LEN(io); - } - IoTYPE(io) = ' '; + return retval; } |