summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorLeon Timmermans <fawaka@gmail.com>2011-01-20 23:32:28 +0100
committerFather Chrysostomos <sprout@cpan.org>2011-01-27 21:41:55 -0800
commit7826b36fbbf24cfa659558ee5af3de424faa2d5a (patch)
treee472d8bcec37bdbe52252dc078353e63793c67f5 /perlio.c
parent364c63cff540b8186bf5b6dcf366e1270ba5020e (diff)
downloadperl-7826b36fbbf24cfa659558ee5af3de424faa2d5a.tar.gz
[perl #38456] binmode FH, ":crlf" only modifies top crlf layer
When pushed on top of the stack, crlf will no longer enable crlf layers lower in the stack. This will prevent unexpected results.
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/perlio.c b/perlio.c
index 130671df0c..07e297ec8e 100644
--- a/perlio.c
+++ b/perlio.c
@@ -4513,7 +4513,7 @@ PerlIOCrlf_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
* any given moment at most one CRLF-capable layer being enabled
* in the whole layer stack. */
PerlIO *g = PerlIONext(f);
- while (PerlIOValid(g)) {
+ if (PerlIOValid(g)) {
PerlIOl *b = PerlIOBase(g);
if (b && b->tab == &PerlIO_crlf) {
if (!(b->flags & PERLIO_F_CRLF))
@@ -4521,8 +4521,7 @@ PerlIOCrlf_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
S_inherit_utf8_flag(g);
PerlIO_pop(aTHX_ f);
return code;
- }
- g = PerlIONext(g);
+ }
}
}
S_inherit_utf8_flag(f);