Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gray-read-line return #647

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Unreleased
<https://github.com/armedbear/abcl/>
<https://gitlab.common-lisp.net/abcl/abcl/>

* [r15753] (Tarn W. Burton) Always return second value indicating EOF
in Gray stream version of CL:READ-LINE as per the ANSI
specification.

* [r15743] (Tarn W. Burton) Add support for implementing
CL:INTERACTIVE-STREAM-P in for Gray streams. This is done via by
making CL:INTERACTIVE-STREAM-P a generic function when the Gray
Expand Down
11 changes: 5 additions & 6 deletions src/org/armedbear/lisp/gray-streams.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,11 @@
(if (ansi-streamp stream)
(funcall *ansi-read-line* stream eof-error-p eof-value recursive-p)
(multiple-value-bind (string eofp)
(stream-read-line stream)
(if eofp
(if (= (length string) 0)
(report-eof stream eof-error-p eof-value)
(values string t))
(values string nil))))))
(stream-read-line stream)
(values (if (and eofp (zerop (length string)))
(report-eof stream eof-error-p eof-value)
string)
eofp)))))

(defun gray-clear-input (&optional input-stream)
(let ((stream (decode-read-arg input-stream)))
Expand Down
Loading