scm_setvbuf doesn't throw away current buffers
authorAndy Wingo <wingo@pobox.com>
Mon, 6 Dec 2010 18:59:15 +0000 (19:59 +0100)
committerAndy Wingo <wingo@pobox.com>
Mon, 6 Dec 2010 18:59:15 +0000 (19:59 +0100)
commit67a72dc13c9d058730361449416ba88c4a6d5dcb
treeb53f36ff13bf4a0fd9ef5881a2e02befe0c464ad
parent4595600a08b7f01b9a4eb8f9d1732f1728989d81
scm_setvbuf doesn't throw away current buffers

* libguile/ports.c (scm_drain_input): Slight optimization.

* libguile/fports.c (scm_setvbuf): If there is buffered output, flush
  it.  If there is input, drain it, and then unread it after updating
  the buffers.  Much more sensible than dropping it silently...
libguile/fports.c
libguile/ports.c