From 284b1c251e959e1417ce6fb38e7bb1a16813663a Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 12 May 2014 12:11:02 -0700 Subject: [PATCH] fixes for Windows paths --- server-routes.rkt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server-routes.rkt b/server-routes.rkt index 9f27126..b4e56fc 100644 --- a/server-routes.rkt +++ b/server-routes.rkt @@ -161,7 +161,7 @@ (define (make-path-row filename-path) (define filename (->string filename-path)) (define possible-source (->source-path (build-path dashboard-dir filename-path))) - (define source (and possible-source (->string possible-source))) + (define source (and possible-source (->string (find-relative-path dashboard-dir possible-source)))) `(tr ,@(map make-link-cell (append (list (cond ; main cell @@ -209,7 +209,11 @@ (define/contract (req->path req) (request? . -> . path?) - (reroot-path (url->path (request-uri req)) (world:current-project-root))) + (define base (world:current-project-root)) + (define file (url->path (request-uri req))) + (if (eq? (system-path-convention-type) 'windows) + (build-path base file) + (reroot-path file base))) ;; default route (define (route-default req)