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();