From a3fdf8f7dae47bf0aed68382b23f3858c575bd06 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Mon, 8 Dec 2008 19:32:50 +0100 Subject: [PATCH] When working with Gray streams, READ-LINE did not handle the EOF properly. --- src/CHANGELOG | 2 ++ src/c/read.d | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/CHANGELOG b/src/CHANGELOG index 94a7981e2..1fd32f0ca 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -200,6 +200,8 @@ ECL 8.9.0: - WRITE-LINE did not work with gray streams (A. Vodonosov) + - When working with Gray streams, READ-LINE did not handle the EOF properly. + ;;; Local Variables: *** ;;; mode:text *** ;;; fill-column:79 *** diff --git a/src/c/read.d b/src/c/read.d index c1dd07853..c0f47f1c0 100644 --- a/src/c/read.d +++ b/src/c/read.d @@ -1522,7 +1522,13 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) strm = stream_or_default_input(strm); #ifdef ECL_CLOS_STREAMS if (type_of(strm) != t_stream) { - return funcall(2, @'gray::stream-read-line', strm); + cl_object out = funcall(2, @'gray::stream-read-line', strm); + if (!Null(VALUES(1))) { + if (!Null(eof_errorp)) + FEend_of_file(strm); + out = eof_value; + } + return out; } #endif token = si_get_buffer_string();