Skip to content
Snippets Groups Projects
Commit 40f31f66 authored by dtc's avatar dtc
Browse files

Fix the handling of :unread and :clear-input in the stream

misc functions synonym-misc, two-way-misc, and concatenated-misc.
These streams encapsulate other input streams which may have an input
buffer so they need to call unread-char and clear-input on the
encapsulated stream rather than directly calling the encapsulated
streams misc method as the misc methods are below the layer of the
input buffer.
parent b8bbec47
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/stream.lisp,v 1.41 2000/06/17 06:34:07 dtc Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/stream.lisp,v 1.42 2000/07/23 14:58:46 dtc Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -804,6 +804,8 @@
(:listen (or (/= (the fixnum (lisp-stream-in-index syn))
in-buffer-length)
(funcall (lisp-stream-misc syn) syn :listen)))
(:clear-input (clear-input syn))
(:unread (unread-char arg1 syn))
(t
(funcall (lisp-stream-misc syn) syn operation arg1 arg2)))
(stream-misc-dispatch syn operation arg1 arg2))))
......@@ -869,10 +871,8 @@
(if out-lisp-stream-p
(funcall (lisp-stream-misc out) out operation arg1 arg2)
(stream-misc-dispatch out operation arg1 arg2)))
((:clear-input :unread)
(if in-lisp-stream-p
(funcall (lisp-stream-misc in) in operation arg1 arg2)
(stream-misc-dispatch in operation arg1 arg2)))
(:clear-input (clear-input in))
(:unread (unread-char arg1 in))
(:element-type
(let ((in-type (stream-element-type in))
(out-type (stream-element-type out)))
......@@ -951,6 +951,8 @@
(return nil))))))
(:close
(set-closed-flame stream))
(:clear-input (clear-input current))
(:unread (unread-char arg1 current))
(t
(if (lisp-stream-p current)
(funcall (lisp-stream-misc current) current operation arg1 arg2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment