Minor bug fix: using a string as a path should be used as a path.

Previously, they were treated as require specs, which was likely bogus.

(This is unrelated to the discussion about the exists problem.)
This commit is contained in:
Eli Barzilay 2012-01-15 20:30:00 -05:00
parent e8356b3b91
commit 952ae06105

View File

@ -211,7 +211,8 @@
(define sandbox-make-logger (make-parameter current-logger)) (define sandbox-make-logger (make-parameter current-logger))
(define (compute-permissions paths+require-perms) (define (compute-permissions paths+require-perms)
(define-values [paths require-perms] (partition path? paths+require-perms)) (define-values [paths require-perms]
(partition path-string? paths+require-perms))
(define cpaths (map path->complete-path paths)) (define cpaths (map path->complete-path paths))
(append (map (lambda (p) `(read ,(path->bytes p))) cpaths) (append (map (lambda (p) `(read ,(path->bytes p))) cpaths)
;; when reading a file from "/foo/bar/baz.rkt" racket will try to see ;; when reading a file from "/foo/bar/baz.rkt" racket will try to see