Convert backslashes to slashes on windows for path inputs.

This applies only to interactive use, using this as a library should
still use generic /-delimited strings.

Fixes PR 11619 -- hopefully.
This commit is contained in:
Eli Barzilay 2011-01-14 11:04:34 -05:00
parent 34e3279f98
commit 05109cf939

View File

@ -403,7 +403,10 @@ path/s is either such a string or a list of them.
(let ([n (find-relative-path root (normalize-path p))])
(if (equal? n root)
""
(let ([n (path->string n)])
(let* ([n (path->string n)]
[n (case (system-type)
[(windows) (regexp-replace* #rx"\\\\" n "/")]
[else n])])
(if (regexp-match #rx"^\\.\\.(?:/|$)" n)
(error* #f "path is not in the racket tree: ~s" p)
n)))))