Update of /cvsroot/sbcl/sbcl/src/code
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv13494/src/code
126.96.36.199: fix overeager input-buffer filling by external-format routines
Previously the character-input functions returned only after filling the
entire request by fast-read-char-refill, or if an EOF was reached.
This meant that on a pipe we would not receive any input until there
was a buffer's worth of it, or the other end closed.
Not so good. New the drill is:
0, N characters requested.
1. Decode upto N characters from binary buffer to the character
2. If any characters were decoded or at EOF, return.
3. Otherwise refill the binary buffer with at most one read()
and goto 1.
Previously at #1 we returned only if the entire request was
RCS file: /cvsroot/sbcl/sbcl/src/code/fd-stream.lisp,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -d -r1.148 -r1.149
--- fd-stream.lisp 27 Sep 2010 15:17:10 -0000 1.148
+++ fd-stream.lisp 30 Sep 2010 08:23:34 -0000 1.149
@@ -1546,8 +1546,8 @@
(return-from ,in-function total-copied)))
(setf (buffer-head ibuf) head)
;; Maybe we need to refill the stream buffer.
- (cond ( ;; If there were enough data in the stream buffer, we're done.
- (= total-copied requested)
+ (cond ( ;; If was data in the stream buffer, we're done.
+ (plusp total-copied)
( ;; If EOF, we're done in another way.
(or (eq decode-break-reason 'eof)