[iolib-devel] Problem with peek-char

Stelian Ionescu sionescu at cddr.org
Sat Mar 27 16:06:27 UTC 2010


On Thu, 2010-03-25 at 12:53 +0300, Andrey Moskvitin wrote:
> Hi,
> 
> 
> > I'm not sure that this is a bug.
> 
> 
> Yes, I sorted out problem more deeply and concluded that in
> stream-read-char 
> required following changes:
> 
> 
> diff --git a/src/streams/gray/gray-stream-methods.lisp
> b/src/streams/gray/gray-stream-methods.lisp
> index 49c2eb1..45a25d1 100644
> --- a/src/streams/gray/gray-stream-methods.lisp
> +++ b/src/streams/gray/gray-stream-methods.lisp
> @@ -332,7 +332,8 @@
>                   (return* :eof))))
>          (cond ((zerop (iobuf-length ib))
>                 (iobuf-reset ib)
> -               (fill-buf-or-eof))
> +               (fill-buf-or-eof)
> +               (setf unread-index (iobuf-start ib)))
>                ;; Some encodings such as CESU or Java's modified UTF-8
> take
>                ;; as much as 6 bytes per character. Make sure we have
> enough
>                ;; space to collect read-ahead bytes if required.

Since the old code was very hard to read in order to understand what was
the bug, I rewrote it. Could you please try again ?


-- 
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.
http://common-lisp.net/project/iolib
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/iolib-devel/attachments/20100327/7ea3d352/attachment.sig>


More information about the iolib-devel mailing list