fixed bug in port-position returning 0 for
(port-position (let ([p (open-string-input-port "Hello")]) (read p) p))
This commit is contained in:
parent
8a277aa95a
commit
4861daf6fc
|
@ -1061,6 +1061,8 @@
|
|||
(die who "invalid return value from read!" n))
|
||||
(unless (<= 0 n (string-length str))
|
||||
(die who "return value from read! is out of range" n))
|
||||
(let ([idx ($port-index p)] [pos-vec ($port-position p)])
|
||||
(vector-set! pos-vec 0 (+ idx (vector-ref pos-vec 0))))
|
||||
($set-port-index! p 0)
|
||||
($set-port-size! p n)
|
||||
(cond
|
||||
|
@ -1113,6 +1115,8 @@
|
|||
(die who "invalid return value from read!" n))
|
||||
(unless (<= 0 n (string-length str))
|
||||
(die who "return value from read! is out of range" n))
|
||||
(let ([idx ($port-index p)] [pos-vec ($port-position p)])
|
||||
(vector-set! pos-vec 0 (+ idx (vector-ref pos-vec 0))))
|
||||
($set-port-size! p n)
|
||||
(cond
|
||||
[(fx= n 0)
|
||||
|
|
|
@ -1 +1 @@
|
|||
1706
|
||||
1707
|
||||
|
|
Loading…
Reference in New Issue