sebuf on stdin was called if any std stream was a tty. Bad. (obs from Ashwin Srinivasan).

This commit is contained in:
Vítor Manuel de Morais Santos Costa 2009-11-10 11:25:56 +00:00
parent b5ad71c9c1
commit 8ecac6c2f9

View File

@ -473,10 +473,13 @@ InitStdStream (int sno, SMALLUNSGN flags, YP_File file)
s->status |= Tty_Stream_f|Promptable_Stream_f;
#endif
#if HAVE_SETBUF
if (s->status & Tty_Stream_f)
if (s->status & Tty_Stream_f &&
sno == 0) {
/* make sure input is unbuffered if it comes from stdin, this
makes life simpler for interrupt handling */
YP_setbuf (stdin, NULL);
// fprintf(stderr,"here I am\n");
}
#endif /* HAVE_SETBUF */
}