From: Ilya Zakharevich Date: Thu, 7 Aug 1997 00:00:00 +0000 (+0000) Subject: Problems with setvbuf X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d924de76f77ae52d0d85935b55bcc109810da0ba;p=p5sagit%2Fp5-mst-13.2.git Problems with setvbuf Nick Ing-Simmons writes: > > I see two possible solutions: > > > > a) correct this on the level of IO.xs (manually check for > > IoIFP(sv_2io(ST(0))); > > I like adding this code to the else branch. This is almost as you ask: p5p-msgid: 199707250040.UAA11000@monk.mps.ohio-state.edu --- diff --git a/ext/IO/IO.xs b/ext/IO/IO.xs index 2eb16f4..e558d5c 100644 --- a/ext/IO/IO.xs +++ b/ext/IO/IO.xs @@ -271,6 +271,8 @@ setvbuf(handle, buf, type, size) CODE: /* Should check HAS_SETVBUF once Configure tests for that */ #if defined(PERLIO_IS_STDIO) && defined(_IOFBF) + if (!handle) /* Try input stream. */ + handle = IoIFP(sv_2io(ST(0))); if (handle) RETVAL = setvbuf(handle, buf, type, size); else {