X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perlio.c;h=49b1b2d1f9d7df7d05aaa18a1887b1cfe1b11788;hb=17fda5459df9207789e2c93a13c6057a90cf1f93;hp=051c67ff3537a1104df216506ac79ef13f8fca5d;hpb=355d3743e65e97364accabb20981fd9938de341c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perlio.c b/perlio.c index 051c67f..49b1b2d 100644 --- a/perlio.c +++ b/perlio.c @@ -1296,9 +1296,10 @@ PerlIO_apply_layers(pTHX_ PerlIO *f, const char *mode, const char *names) int PerlIO_binmode(pTHX_ PerlIO *f, int iotype, int mode, const char *names) { - PerlIO_debug("PerlIO_binmode f=%p %s %c %x %s\n", - (void*)f, PerlIOBase(f)->tab->name, iotype, mode, - (names) ? names : "(Null)"); + PerlIO_debug("PerlIO_binmode f=%p %s %c %x %s\n", (void*)f, + (PerlIOBase(f)) ? PerlIOBase(f)->tab->name : "(Null)", + iotype, mode, (names) ? names : "(Null)"); + if (names) { /* Do not flush etc. if (e.g.) switching encodings. if a pushed layer knows it needs to flush lower layers @@ -3169,7 +3170,7 @@ PerlIOStdio_flush(pTHX_ PerlIO *f) /* * Not writeable - sync by attempting a seek */ - int err = errno; + const int err = errno; if (PerlSIO_fseek(stdio, (Off_t) 0, SEEK_CUR) != 0) errno = err; #endif