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.
Showing
Loading
Please register or sign in to comment