close the input after reading

svn: r12775
This commit is contained in:
Eli Barzilay 2008-12-11 18:00:43 +00:00
parent 251d15f800
commit baffbeeeb2

View File

@ -322,7 +322,9 @@
(cond [(and p (null? (cdr inps)))
(port-count-lines! p)
(parameterize ([current-input-port p])
((sandbox-reader) source))]
((sandbox-reader) source)
;; close a port if we opened it
(unless (eq? p (car inps)) (close-input-port p)))]
[p (error 'input->code "ambiguous inputs: ~e" inps)]
[else (let loop ([inps inps] [n n] [r '()])
(if (null? inps)