diff --git a/collects/racket/file.rkt b/collects/racket/file.rkt index 6a768e6704..d7b808c922 100644 --- a/collects/racket/file.rkt +++ b/collects/racket/file.rkt @@ -546,7 +546,8 @@ (define (do-paths paths acc) (cond [(null? 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]) (reverse diff --git a/collects/tests/racket/filelib.rktl b/collects/tests/racket/filelib.rktl index c3eeb32f6e..3212c5e6f0 100644 --- a/collects/tests/racket/filelib.rktl +++ b/collects/tests/racket/filelib.rktl @@ -68,6 +68,12 @@ (test (list (build-path (current-directory) "filelib.rktl")) find-files (lambda (f) (regexp-match "filelib[.]rktl$" (path->string f))) (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) (test kind name (if (file-exists? name)