fix module-path-index->taglet bug that is mainly exposed when the current directory is a root directory

svn: r10231
This commit is contained in:
Matthew Flatt 2008-06-12 13:39:23 +00:00
parent 20fcb6314c
commit 64147e45ab
2 changed files with 11 additions and 5 deletions

View File

@ -104,7 +104,7 @@
;; Derive the name from the module path:
(let ([p (collapse-module-path-index
mod
(current-directory))])
(build-path (current-directory) "dummy"))])
(if (path? p)
;; If we got a path back anyway, then it's best to use the resolved
;; name; if the current directory has changed since we

View File

@ -45,11 +45,18 @@
(define (combine-relative-elements elements)
(define (extract-base relto)
(let-values ([(base n d?) (split-path relto)])
(if (eq? base 'relative)
'same
(if (not base)
relto ; strange case: relto is a root directory
base))))
;; Used for 'file paths, so it's platform specific:
(define (attach-to-relative-path relto)
(apply build-path
(let-values ([(base n d?) (split-path relto)])
(if (eq? base 'relative) 'same base))
(extract-base relto)
(map (lambda (i) (if (bytes? i) (bytes->path i) i))
elements)))
@ -58,8 +65,7 @@
(cond
[(or (path? relto-mp) (and (string? relto-mp) (ormap path? elements)))
(apply build-path
(let-values ([(base name dir?) (split-path relto-mp)])
(if (eq? base 'relative) 'same base))
(extract-base relto-mp)
(map (lambda (x) (if (bytes? x) (bytes->path x) x))
elements))]
[(string? relto-mp)