diff options
author | chromatic <chromatic@wgz.org> | 2001-09-25 17:57:07 -0600 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-26 12:57:11 +0000 |
commit | 89aec743e18bc6ebc8fe067d7c780485893d0a8c (patch) | |
tree | 68f6d62b9ae394f5c11246b0c84e4873f1565a4b /perlio.c | |
parent | be708cc0141c68546a70e3d19f68ad41bef15add (diff) | |
download | perl-89aec743e18bc6ebc8fe067d7c780485893d0a8c.tar.gz |
Re: binmode(STDOUT, ":unix") busted when STDOUT is piped.
Message-ID: <20010926060233.7554.qmail@onion.perl.org>
p4raw-id: //depot/perl@12236
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -945,15 +945,16 @@ PerlIO_binmode(pTHX_ PerlIO *f, int iotype, int mode, const char *names) PerlIO_debug("PerlIO_binmode f=%p %s %c %x %s\n", f, PerlIOBase(f)->tab->name, iotype, mode, (names) ? names : "(Null)"); + PerlIO_flush(f); if (!names && (O_TEXT != O_BINARY && (mode & O_BINARY))) { PerlIO *top = f; while (*top) { if (PerlIOBase(top)->tab == &PerlIO_crlf) { - PerlIO_flush(top); PerlIOBase(top)->flags &= ~PERLIO_F_CRLF; break; } top = PerlIONext(top); + PerlIO_flush(top); } } return PerlIO_apply_layers(aTHX_ f, NULL, names) == 0 ? TRUE : FALSE; |