mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-07 13:16:36 +02:00
Adding closedir call to directory-fold-tree.
This commit is contained in:
parent
2d8371c258
commit
7004feed5e
1 changed files with 4 additions and 1 deletions
|
@ -28,7 +28,9 @@
|
||||||
(let ((dir (opendir dir)))
|
(let ((dir (opendir dir)))
|
||||||
(let lp ((res knil))
|
(let lp ((res knil))
|
||||||
(let ((file (readdir dir)))
|
(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
|
;;> Returns a list of the files in \var{dir} in an unspecified
|
||||||
;;> order.
|
;;> order.
|
||||||
|
@ -61,6 +63,7 @@
|
||||||
(let ((path (string-append file "/" f)))
|
(let ((path (string-append file "/" f)))
|
||||||
(lp (fold path (down path acc)))))))
|
(lp (fold path (down path acc)))))))
|
||||||
(else
|
(else
|
||||||
|
(closedir d)
|
||||||
(up file acc))))))))
|
(up file acc))))))))
|
||||||
(else
|
(else
|
||||||
(here file acc))))))
|
(here file acc))))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue