diff --git a/src/c/read.d b/src/c/read.d index ba92e522c..90a0a5267 100644 --- a/src/c/read.d +++ b/src/c/read.d @@ -1630,7 +1630,7 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) if (!ECL_ANSI_STREAM_P(strm)) { value0 = _ecl_funcall2(@'gray::stream-read-line', strm); value1 = ecl_nth_value(the_env, 1); - if (!Null(value1)) { + if (Null(value0) && !Null(value1)) { if (!Null(eof_errorp)) FEend_of_file(strm); value0 = eof_value; diff --git a/src/clos/streams.lsp b/src/clos/streams.lsp index ec2e79c00..6b359258c 100644 --- a/src/clos/streams.lsp +++ b/src/clos/streams.lsp @@ -512,7 +512,10 @@ (loop (let ((ch (stream-read-char stream))) (cond ((eq ch :eof) - (return (values (si::shrink-vector res index) t))) + (return (values (if (zerop index) + nil + (si::shrink-vector res index)) + t))) (t (when (char= ch #\newline) (return (values (si::shrink-vector res index) nil)))