From a0fdca838e86ab6a034cf394e1e461363187837c Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Tue, 22 Feb 2011 15:28:06 +0100 Subject: [PATCH] Fix printing of closed streams --- src/streams/gray/gray-stream-methods.lisp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/streams/gray/gray-stream-methods.lisp b/src/streams/gray/gray-stream-methods.lisp index f85f877..ee52e36 100644 --- a/src/streams/gray/gray-stream-methods.lisp +++ b/src/streams/gray/gray-stream-methods.lisp @@ -42,12 +42,17 @@ (with-slots (fd (ef external-format) (ib input-buffer) (ob output-buffer)) o (print-unreadable-object (o s :type nil :identity t) - (format s "~A ~S ~S ~S ~S/~S ~S ~S/~S ~S (~S ~S ~S)" - (type-of o) :fd fd - :ibuf (iobuf-length ib) (iobuf-size ib) - :obuf (iobuf-length ob) (iobuf-size ob) - :ef (babel-encodings:enc-name (babel:external-format-encoding ef)) - :eol-style (babel:external-format-eol-style ef))))) + (if fd + (format s "~A ~S ~S ~S ~S/~S ~S ~S/~S ~S (~S ~S ~S)" + (type-of o) :fd fd + :ibuf (iobuf-length ib) (iobuf-size ib) + :obuf (iobuf-length ob) (iobuf-size ob) + :ef (babel-encodings:enc-name (babel:external-format-encoding ef)) + :eol-style (babel:external-format-eol-style ef)) + (format s "~A ~A ~S (~S ~S ~S)" + (type-of o) :closed + :ef (babel-encodings:enc-name (babel:external-format-encoding ef)) + :eol-style (babel:external-format-eol-style ef)))))) ;;;------------------------------------------------------------------------- -- 2.11.4.GIT