klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit e9b17c256904fb13a56d38cab7a40a912cff34f8
parent e49757f7b83a3eea22431a0d9b759087024c80d0
Author: Oto Havle <havleoto@gmail.com>
Date:   Fri, 21 Oct 2011 10:40:14 +0200

Fixed bugs in i/o features - (display ...) shall not quote empty string, (read-char) shall work inside (load ...).

Diffstat:
Msrc/kread.c | 4++++
Msrc/kwrite.c | 3++-
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/kread.c b/src/kread.c @@ -528,6 +528,10 @@ TValue kread_from_port(klisp_State *K, TValue port, bool mut) TValue kread_peek_char_from_port(klisp_State *K, TValue port, bool peek) { + /* Reset the EOF flag in the tokenizer. The flag is shared, + by operations on all ports. */ + K->ktok_seen_eof = false; + K->curr_port = port; K->curr_in = kport_file(port); int ch; diff --git a/src/kwrite.c b/src/kwrite.c @@ -517,7 +517,8 @@ void kwrite_fsm(klisp_State *K, TValue obj) } case K_TSTRING: { if (kstring_emptyp(obj)) { - kw_printf(K, "\"\""); + if (!K->write_displayp) + kw_printf(K, "\"\""); } else { TValue mark = kget_mark(obj); if (K->write_displayp || ttisboolean(mark)) {