mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 06:50:31 +02:00
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.
This commit is contained in:
parent
de92987002
commit
fa8110f241
1 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue