From 1434e8ef039d7558e3ec8b3247bcb74a8356ee33 Mon Sep 17 00:00:00 2001 From: gerd <gerd> Date: Wed, 5 Nov 2003 16:47:18 +0000 Subject: [PATCH] * src/code/fd-stream.lisp (output-raw-bytes): Same theme as last change, which fixed write-char etc. only. --- code/fd-stream.lisp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/fd-stream.lisp b/code/fd-stream.lisp index 0a6bbc2f1..1b861c8e4 100644 --- a/code/fd-stream.lisp +++ b/code/fd-stream.lisp @@ -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/fd-stream.lisp,v 1.73 2003/11/03 16:50:28 gerd Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/fd-stream.lisp,v 1.74 2003/11/05 16:47:18 gerd Exp $") ;;; ;;; ********************************************************************** ;;; @@ -355,6 +355,13 @@ (let ((start (or start 0)) (end (or end (length (the (simple-array * (*)) thing))))) (declare (type index start end)) + ;; + ;; If there is any input read from UNIX but not + ;; supplied to the user of the stream, reposition + ;; to the real file position as seen from Lisp. + (when (> (fd-stream-ibuf-tail stream) + (fd-stream-ibuf-head stream)) + (file-position stream (file-position stream))) (let* ((len (fd-stream-obuf-length stream)) (tail (fd-stream-obuf-tail stream)) (space (- len tail)) -- GitLab