X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Fguile%2Fhubmgr;h=8da04f5d1fda7f22e7e08f248235e4470f152e10;hb=91328d65ff872c86ee23f38e87793b853b6404ea;hp=5d8de7493deb139a987d03c9936a52b2dfab4695;hpb=ae95803603ca867792cbbab6333348cb856fcfe2;p=doldaconnect.git diff --git a/lib/guile/hubmgr b/lib/guile/hubmgr index 5d8de74..8da04f5 100755 --- a/lib/guile/hubmgr +++ b/lib/guile/hubmgr @@ -50,22 +50,18 @@ (list r1 r2 l2))) (define (read-hl) - (catch 'system-error - (lambda () - (let ((p (open-input-file hl-file))) - (catch 'eof - (lambda () - (let ((lines '())) - (while #t - (let ((line (read-line p))) - (if (eof-object? line) - (throw 'eof lines) - (let ((lexed (dc-lexsexpr line))) - (if (> (length lexed) 0) - (set! lines (append lines (list lexed)))))))))) - (lambda (s a) (close-port p) a)))) - (lambda (key . args) - '()))) + (letrec ((read-lines (lambda (lines p) + (let ((line (read-line p))) + (if (eof-object? line) + (begin (close-port p) + lines) + (read-lines (let ((lexed (dc-lexsexpr line))) + (if (> (length lexed) 0) + (append lines (list lexed)) + lines)) p)))))) + (catch 'system-error + (lambda () (read-lines '() (open-input-file hl-file))) + (lambda (key . args) '())))) (define (cklist) (set! statelist (let ((nl '()) (ct (current-time)))