Fix checking of path existence: use the input path, not the normalized one.

This commit is contained in:
Eli Barzilay 2010-05-13 01:25:30 -04:00
parent 27f76f2da0
commit e6761dc7b1

View File

@ -395,17 +395,17 @@ path/s is either such a string or a list of them.
(for/list ([p (in-lines (current-input-port))]) p) (for/list ([p (in-lines (current-input-port))]) p)
(let ([root (normalize-path (find-root))]) (let ([root (normalize-path (find-root))])
(define (norm p) (define (norm p)
(unless (or (not check-existing-paths?)
(file-exists? p)
(directory-exists? p))
(error* #f "path does not exist: ~s" p))
(let ([n (find-relative-path root (normalize-path p))]) (let ([n (find-relative-path root (normalize-path p))])
(cond (if (equal? n root)
[(not (or (not check-existing-paths?) ""
(file-exists? n) (let ([n (path->string n)])
(directory-exists? n)))
(error* #f "path does not exist: ~s" p)]
[(equal? n root) ""]
[else (let ([n (path->string n)])
(if (regexp-match #rx"^\\.\\.(?:/|$)" n) (if (regexp-match #rx"^\\.\\.(?:/|$)" n)
(error* #f "path is not in the plt tree: ~s" p) (error* #f "path is not in the plt tree: ~s" p)
n))]))) n)))))
(if (null? paths) (norm path) (map norm (cons path paths)))))) (if (null? paths) (norm path) (map norm (cons path paths))))))
(define (get prop path . paths) (define (get prop path . paths)
(let ([prop (string->symbol prop)] (let ([prop (string->symbol prop)]