From: Chris Hanson Date: Thu, 13 Sep 2007 13:58:04 +0000 (+0000) Subject: Fix READ-CHAR-NO-HANG to account for CHAR-READY? returning #T on EOF. X-Git-Tag: 20090517-FFI~439 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=eea59097b7f838e5030a7960e792380d09381cee;p=mit-scheme.git Fix READ-CHAR-NO-HANG to account for CHAR-READY? returning #T on EOF. --- diff --git a/v7/src/runtime/input.scm b/v7/src/runtime/input.scm index 560acab08..3f301651b 100644 --- a/v7/src/runtime/input.scm +++ b/v7/src/runtime/input.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: input.scm,v 14.37 2007/09/12 23:35:00 cph Exp $ +$Id: input.scm,v 14.38 2007/09/13 13:58:04 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -181,10 +181,10 @@ USA. (define (read-char-no-hang #!optional port) (let ((port (optional-input-port port 'READ-CHAR-NO-HANG))) - (if (input-port/char-ready? port) - (input-port/read-char port) - (and (input-port/eof? port) - (eof-object))))) + (and (input-port/char-ready? port) + (if (input-port/eof? port) + (eof-object) + (input-port/read-char port))))) (define (read-string delimiters #!optional port) (input-port/read-string (optional-input-port port 'READ-STRING) delimiters))