mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-11 23:17:34 +02:00
return null string on (read-string 0)
This commit is contained in:
parent
08554fd29c
commit
de539a472e
1 changed files with 11 additions and 9 deletions
|
@ -44,6 +44,8 @@
|
|||
res))))))
|
||||
|
||||
(define (read-string n . o)
|
||||
(if (zero? n)
|
||||
""
|
||||
(let ((in (if (pair? o) (car o) (current-input-port))))
|
||||
(let ((res (%read-string n in)))
|
||||
(cond
|
||||
|
@ -52,7 +54,7 @@
|
|||
(else
|
||||
(port-line-set! in (+ (string-count #\newline (cadr res))
|
||||
(port-line in)))
|
||||
(cadr res))))))
|
||||
(cadr res)))))))
|
||||
|
||||
(define (read-string! str n . o)
|
||||
(let* ((in (if (pair? o) (car o) (current-input-port)))
|
||||
|
|
Loading…
Add table
Reference in a new issue