X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ffd-stream.lisp;h=8c0ca30704f604076176e2670bfe987bc2a94d88;hb=18c093eb771c1ab038090863d99bf4baf4224966;hp=789e9621c8e4c96aa4000f6f08c444f5e5ff5917;hpb=1e786e1a23a1f2276ec2dbe197dcc31a53b43738;p=sbcl.git diff --git a/src/code/fd-stream.lisp b/src/code/fd-stream.lisp index 789e962..8c0ca30 100644 --- a/src/code/fd-stream.lisp +++ b/src/code/fd-stream.lisp @@ -525,7 +525,7 @@ (tail (buffer-tail obuf)) (size ,size)) ,(unless (eq (car buffering) :none) - `(when (<= (buffer-length obuf) (+ tail size)) + `(when (< (buffer-length obuf) (+ tail size)) (setf obuf (flush-output-buffer ,stream-var) tail (buffer-tail obuf)))) ,(unless (eq (car buffering) :none) @@ -552,28 +552,28 @@ `(let* ((,stream-var ,stream) (obuf (fd-stream-obuf ,stream-var)) (tail (buffer-tail obuf))) - ,(unless (eq (car buffering) :none) - `(when (<= (buffer-length obuf) (+ tail ,size)) - (setf obuf (flush-output-buffer ,stream-var) - tail (buffer-tail obuf)))) - ;; FIXME: Why this here? Doesn't seem necessary. - ,(unless (eq (car buffering) :none) - `(synchronize-stream-output ,stream-var)) - ,(if restart - `(catch 'output-nothing - ,@body - (setf (buffer-tail obuf) (+ tail ,size))) - `(progn - ,@body - (setf (buffer-tail obuf) (+ tail ,size)))) - ,(ecase (car buffering) - (:none - `(flush-output-buffer ,stream-var)) - (:line - `(when (eql byte #\Newline) - (flush-output-buffer ,stream-var))) - (:full)) - (values)))) + ,(unless (eq (car buffering) :none) + `(when (< (buffer-length obuf) (+ tail ,size)) + (setf obuf (flush-output-buffer ,stream-var) + tail (buffer-tail obuf)))) + ;; FIXME: Why this here? Doesn't seem necessary. + ,(unless (eq (car buffering) :none) + `(synchronize-stream-output ,stream-var)) + ,(if restart + `(catch 'output-nothing + ,@body + (setf (buffer-tail obuf) (+ tail ,size))) + `(progn + ,@body + (setf (buffer-tail obuf) (+ tail ,size)))) + ,(ecase (car buffering) + (:none + `(flush-output-buffer ,stream-var)) + (:line + `(when (eql byte #\Newline) + (flush-output-buffer ,stream-var))) + (:full)) + (values)))) (defmacro def-output-routines/variable-width ((name-fmt size restart external-format &rest bufferings)