From e6761dc7b1381d28b15abfe0a3af4fa450b1fad8 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 13 May 2010 01:25:30 -0400 Subject: [PATCH] Fix checking of path existence: use the input path, not the normalized one. --- collects/meta/props | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/collects/meta/props b/collects/meta/props index 63bc0cfbbc..c49f570be6 100755 --- a/collects/meta/props +++ b/collects/meta/props @@ -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) (let ([root (normalize-path (find-root))]) (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))]) - (cond - [(not (or (not check-existing-paths?) - (file-exists? 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) - (error* #f "path is not in the plt tree: ~s" p) - n))]))) + (if (equal? n root) + "" + (let ([n (path->string n)]) + (if (regexp-match #rx"^\\.\\.(?:/|$)" n) + (error* #f "path is not in the plt tree: ~s" p) + n))))) (if (null? paths) (norm path) (map norm (cons path paths)))))) (define (get prop path . paths) (let ([prop (string->symbol prop)]