From a25d20a3cb7b6e54074fa685ec9c6995ea72eb3c Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Wed, 10 Dec 2008 12:13:29 +0100 Subject: [PATCH] READ-LINE did not support Gray streams --- src/CHANGELOG | 2 +- src/c/read.d | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/CHANGELOG b/src/CHANGELOG index a2aa153f8..34b80cdb0 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -198,7 +198,7 @@ ECL 8.9.0: - Hash tables were not properly serialized. - - WRITE-LINE did not work with gray streams (A. Vodonosov) + - WRITE/READ-LINE did not work with gray streams (A. Vodonosov) - When working with Gray streams, READ-LINE did not handle the EOF properly. diff --git a/src/c/read.d b/src/c/read.d index c0f47f1c0..a8b4ac259 100644 --- a/src/c/read.d +++ b/src/c/read.d @@ -1522,13 +1522,12 @@ 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) { - cl_object out = funcall(2, @'gray::stream-read-line', strm); + token = funcall(2, @'gray::stream-read-line', strm); if (!Null(VALUES(1))) { - if (!Null(eof_errorp)) - FEend_of_file(strm); - out = eof_value; + c = EOF; + goto EOFCHK; } - return out; + return token; } #endif token = si_get_buffer_string(); @@ -1538,7 +1537,7 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) break; ecl_string_push_extend(token, c); } while(1); - if (c == EOF && token->base_string.fillp == 0) { +EOFCHK: if (c == EOF && token->base_string.fillp == 0) { if (!Null(eof_errorp)) FEend_of_file(strm); value0 = eof_value;