From 7004feed5e29061135e15a535042313dc25525ac Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Thu, 3 Oct 2013 12:30:24 +0900 Subject: [PATCH] Adding closedir call to directory-fold-tree. --- lib/chibi/filesystem.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/chibi/filesystem.scm b/lib/chibi/filesystem.scm index a07ac59c..bc16de8a 100644 --- a/lib/chibi/filesystem.scm +++ b/lib/chibi/filesystem.scm @@ -28,7 +28,9 @@ (let ((dir (opendir dir))) (let lp ((res knil)) (let ((file (readdir dir))) - (if file (lp (kons (dirent-name file) res)) res))))) + (if file + (lp (kons (dirent-name file) res)) + (begin (closedir dir) res)))))) ;;> Returns a list of the files in \var{dir} in an unspecified ;;> order. @@ -61,6 +63,7 @@ (let ((path (string-append file "/" f))) (lp (fold path (down path acc))))))) (else + (closedir d) (up file acc)))))))) (else (here file acc))))))