From 15bfa90966aff403228f95c0edbf810ec75b5ab1 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 6 Apr 2006 20:13:04 +0000 Subject: [PATCH] fix collapse-module-path for Windows when actual paths are involed svn: r2628 --- collects/syntax/moddep.ss | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/collects/syntax/moddep.ss b/collects/syntax/moddep.ss index b16e930361..c103883814 100644 --- a/collects/syntax/moddep.ss +++ b/collects/syntax/moddep.ss @@ -338,15 +338,19 @@ (when (procedure? relto-mp) (set! relto-mp (relto-mp))) (cond - [(path-string? relto-mp) - ((if (path? relto-mp) - bytes->path - bytes->string/locale) + [(or (path? relto-mp) + (and (string? relto-mp) + (ormap path? elements))) + (apply build-path + (let-values ([(base name dir?) (split-path relto-mp)]) + base) + (map (lambda (x) (if (bytes? x) (bytes->path x) x)) + elements))] + [(string? relto-mp) + (bytes->string/locale (apply bytes-append - (let ([m (regexp-match re:path-only (if (path? relto-mp) - (path->bytes relto-mp) - (string->bytes/locale relto-mp)))]) + (let ([m (regexp-match re:path-only (string->bytes/locale relto-mp))]) (if m (cadr m) #"."))