From ba597e6b906a5fd35a36e20f78f7588bd5bb2fed Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Wed, 12 Jan 2011 15:31:47 +0100 Subject: [PATCH] Do not push the output of stream-read-line into the string buffer --- src/c/read.d | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/c/read.d b/src/c/read.d index 1ee90e791..c8eef53fd 100644 --- a/src/c/read.d +++ b/src/c/read.d @@ -1484,12 +1484,15 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) strm = stream_or_default_input(strm); #ifdef ECL_CLOS_STREAMS if (!ECL_ANSI_STREAM_P(strm)) { - token = funcall(2, @'gray::stream-read-line', strm); - if (!Null(VALUES(1))) { - c = EOF; - goto EOFCHK; + value0 = funcall(2, @'gray::stream-read-line', strm); + value1 = VALUES(1); + if (!Null(value1)) { + if (!Null(eof_errorp)) + FEend_of_file(strm); + value0 = eof_value; + value1 = Ct; } - return token; + goto OUTPUT; } #endif token = si_get_buffer_string(); @@ -1499,7 +1502,7 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) break; ecl_string_push_extend(token, c); } while(1); -EOFCHK: if (c == EOF && TOKEN_STRING_FILLP(token) == 0) { + if (c == EOF && TOKEN_STRING_FILLP(token) == 0) { if (!Null(eof_errorp)) FEend_of_file(strm); value0 = eof_value; @@ -1517,6 +1520,7 @@ EOFCHK: if (c == EOF && TOKEN_STRING_FILLP(token) == 0) { value1 = (c == EOF? Ct : Cnil); } si_put_buffer_string(token); + OUTPUT: @(return value0 value1) @)