summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2000-11-20 23:20:18 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2000-11-20 23:20:18 +0000
commit88b61e10dfef3b0642d1458a9fff93e5000f86b0 (patch)
treea9ccc062b09aba8caba31f019790e1a9f7c23abe /doio.c
parent66ecd56be076649bc9da523c12d89e06e353e801 (diff)
downloadperl-88b61e10dfef3b0642d1458a9fff93e5000f86b0.tar.gz
Make extra buffer layer work (dummy crlf layer)
p4raw-id: //depot/perlio@7788
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/doio.c b/doio.c
index 14e48b2d8f..724779530c 100644
--- a/doio.c
+++ b/doio.c
@@ -419,16 +419,16 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
IoTYPE(io) = IoTYPE_RDONLY;
/*SUPPRESS 530*/
for (; isSPACE(*name); name++) ;
+ mode[0] = 'r';
+ if (in_raw)
+ strcat(mode, "b");
+ else if (in_crlf)
+ strcat(mode, "t");
if (strEQ(name,"-")) {
fp = PerlIO_stdin();
IoTYPE(io) = IoTYPE_STD;
}
else {
- mode[0] = 'r';
- if (in_raw)
- strcat(mode, "b");
- else if (in_crlf)
- strcat(mode, "t");
fp = PerlIO_open(name,mode);
}
}
@@ -439,8 +439,7 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
Perl_warner(aTHX_ WARN_NEWLINE, PL_warn_nl, "open");
goto say_false;
}
- if (IoTYPE(io) &&
- IoTYPE(io) != IoTYPE_PIPE && IoTYPE(io) != IoTYPE_STD) {
+ if (IoTYPE(io) && IoTYPE(io) != IoTYPE_PIPE && IoTYPE(io) != IoTYPE_STD) {
dTHR;
if (PerlLIO_fstat(PerlIO_fileno(fp),&PL_statbuf) < 0) {
(void)PerlIO_close(fp);