Comment 0 for bug 1884220

Revision history for this message
ryosuke sasaki (cxxxr) wrote :

$ uname -a
Darwin usernoMacBook-puro.local 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64

* (lisp-implementation-version)
"2.0.5"

(let ((start 1))
  (with-input-from-string (in "abc" :start start)
    (assert (eql start (file-position in)))))

Expect the return value of file-positioin to be start, but the actual value will be 0.

Changing this line to the following gave the correct result.

https://github.com/sbcl/sbcl/blob/790a82f7b6989100b74c7b9346f9b5adb6647655/src/code/stream.lisp#L1282

< (- (string-input-stream-index stream)
< (string-input-stream-start stream))))
---
> (string-input-stream-index stream)))