diff options
author | Ludovic Courtès <ludo@gnu.org> | 2011-12-19 09:18:42 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2011-12-19 09:18:42 +0100 |
commit | fa8110f2412c260d69db10739357ea593eb9eefe (patch) | |
tree | c16e67efa36a4df8f2cd2ca7ebf949f14c6fdc77 /module | |
parent | de92987002224276dafc0875873b30149e964828 (diff) |
ftw: Fix typos/thinkos in `file-system-fold' and `scandir'.
* module/ice-9/ftw.scm (file-system-fold): Fix reference to STAT instead
of ST.
(scandir)[enter?]: Change the argument name to `dir', to avoid
confusion.
[skip]: Return RESULT, not #f.
Diffstat (limited to 'module')
-rw-r--r-- | module/ice-9/ftw.scm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/module/ice-9/ftw.scm b/module/ice-9/ftw.scm index bbb2bbe6c..eed3eeb19 100644 --- a/module/ice-9/ftw.scm +++ b/module/ice-9/ftw.scm @@ -457,7 +457,7 @@ The optional STAT parameter defaults to `lstat'." (else (let* ((child (string-append full-name "/" entry)) (st (false-if-exception (stat child)))) - (if (and stat (eq? (stat:type st) 'directory)) + (if (and st (eq? (stat:type st) 'directory)) (liip (readdir dir) result (alist-cons entry st subdirs)) @@ -513,8 +513,8 @@ children. The optional STAT parameter defaults to `lstat'." that match predicate SELECT? (by default, all files.) The returned list of file names is sorted according to ENTRY<?, which defaults to `string-locale<?'. Return #f when NAME is unreadable or is not a directory." - (define (enter? name stat result) - (and stat (string=? name name))) + (define (enter? dir stat result) + (and stat (string=? dir name))) (define (leaf name stat result) (if (select? name) @@ -529,8 +529,8 @@ of file names is sorted according to ENTRY<?, which defaults to (cons ".." result)) (define (skip name stat result) - ;; NAME itself is not readable. - #f) + ;; All the sub-directories are skipped. + result) (and=> (file-system-fold enter? leaf down up skip #f name stat) (lambda (files) |