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
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 {