fix `find-files' to convert an initial string into a path
Merge to 5.2.1
This commit is contained in:
parent
108c32e11f
commit
60c418b20e
|
@ -546,7 +546,8 @@
|
||||||
(define (do-paths paths acc)
|
(define (do-paths paths acc)
|
||||||
(cond [(null? paths) acc]
|
(cond [(null? paths) acc]
|
||||||
[else (do-paths (cdr paths) (do-path (car paths) acc))]))
|
[else (do-paths (cdr paths) (do-path (car paths) acc))]))
|
||||||
(if path (do-path path init) (do-paths (sorted-dirlist) init)))
|
(define (to-path s) (if (path? s) s (string->path s)))
|
||||||
|
(if path (do-path (to-path path) init) (do-paths (sorted-dirlist) init)))
|
||||||
|
|
||||||
(define (find-files f [path #f])
|
(define (find-files f [path #f])
|
||||||
(reverse
|
(reverse
|
||||||
|
|
|
@ -68,6 +68,12 @@
|
||||||
(test (list (build-path (current-directory) "filelib.rktl"))
|
(test (list (build-path (current-directory) "filelib.rktl"))
|
||||||
find-files (lambda (f) (regexp-match "filelib[.]rktl$" (path->string f)))
|
find-files (lambda (f) (regexp-match "filelib[.]rktl$" (path->string f)))
|
||||||
(current-directory))
|
(current-directory))
|
||||||
|
;; check that path as string gives paths (not strings) to checker and result:
|
||||||
|
(test (list (current-directory)
|
||||||
|
(build-path (current-directory) "filelib.rktl"))
|
||||||
|
find-files (lambda (f) (or (equal? f (current-directory))
|
||||||
|
(regexp-match "filelib[.]rktl$" (path->string f))))
|
||||||
|
(path->string (current-directory)))
|
||||||
|
|
||||||
(let ([rel2 (fold-files (lambda (name kind accum)
|
(let ([rel2 (fold-files (lambda (name kind accum)
|
||||||
(test kind name (if (file-exists? name)
|
(test kind name (if (file-exists? name)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user