From eb8fc26c59a3cdf97ff1c313a7990cfc75c7e447 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 7 Jul 2013 11:58:35 -0600 Subject: [PATCH] fix bug and test for `path->relative-string/library' --- pkgs/racket-pkgs/racket-test/tests/racket/setup.rktl | 2 +- racket/lib/collects/setup/path-to-relative.rkt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/racket-pkgs/racket-test/tests/racket/setup.rktl b/pkgs/racket-pkgs/racket-test/tests/racket/setup.rktl index 6c3e40e51b..c59330dada 100644 --- a/pkgs/racket-pkgs/racket-test/tests/racket/setup.rktl +++ b/pkgs/racket-pkgs/racket-test/tests/racket/setup.rktl @@ -16,7 +16,7 @@ (test lib-expected path->relative-string/library path)) (test-both missing missing) (test-both relative relative) - (test-both collects "racket/foo.rkt" "/racket/foo.rkt") + (test-both collects "/racket/foo.rkt" "/racket/foo.rkt") (err/rt-test (path->relative-string/setup #f)) (err/rt-test (path->relative-string/setup #"bleh")) (err/rt-test (path->relative-string/setup 'bleh))) diff --git a/racket/lib/collects/setup/path-to-relative.rkt b/racket/lib/collects/setup/path-to-relative.rkt index af213be147..a70c613d71 100644 --- a/racket/lib/collects/setup/path-to-relative.rkt +++ b/racket/lib/collects/setup/path-to-relative.rkt @@ -56,7 +56,9 @@ (cons find-planet-dir "/")))) (define (make-default cache default) (lambda (x) - (define-values (pkg sub) (path->pkg+subpath x #:cache cache)) + (define-values (pkg sub) (if (complete-path? x) + (path->pkg+subpath x #:cache cache) + (values #f #f))) (cond [pkg (apply string-append