Skip to content
Snippets Groups Projects
Commit dd7132b7 authored by rtoy's avatar rtoy
Browse files

Fix the bug reported by Madhu on cmucl-imp, 2006/12/16:

(defvar $f (open "/etc/passwd" :mapped t :class 'stream:file-simple-stream))
(file-position $f)

returns a negative value.

I think this happens because of some possible confusion between
buffer-ptr and buf-len in a mapped file-simple-stream.  I changed the
code so that buffer-ptr is initialized to 0, and the various routines
that check for eof compare buffpos against buf-len, instead of
buffer-ptr.  I think this also means buffer-ptr is not used in mapped
file-simple-streams.

Add a couple of file-position tests too.
parent d2dcf0fa
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment