@@ -43,11 +43,14 @@ (key-sys-pr (regexp "^(\\S+)\\s+\\[system\\s+(\\S+.*)\\]\\s*$")) (key-val-pr (regexp "^(\\S+)\\s+(.*)$")) (comment-rx (regexp "^\\s*#.*"))) (let loop ((inl (read-line inp)) (curr-section-name "default")) - (if (eof-object? inl) res + (if (eof-object? inl) + (begin + (close-input-port inp) + res) (regex-case inl (comment-rx _ (loop (read-line inp) curr-section-name)) (blank-l-rx _ (loop (read-line inp) curr-section-name)) (include-rx ( x include-file ) (begin @@ -73,12 +76,11 @@ (hash-table-set! res curr-section-name (config:assoc-safe-add alist key val)) ;; (append alist (list (list key val)))) (loop (read-line inp) curr-section-name))) (else (debug:print 0 "ERROR: problem parsing " path ",\n \"" inl "\"") - (loop (read-line inp) curr-section-name))))) - (close-input-port inp)))) + (loop (read-line inp) curr-section-name)))))))) (define (find-and-read-config fname) (let* ((curr-dir (current-directory)) (configinfo (find-config fname)) (toppath (car configinfo))