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:
parent
20fcb6314c
commit
64147e45ab
|
@ -104,7 +104,7 @@
|
||||||
;; Derive the name from the module path:
|
;; Derive the name from the module path:
|
||||||
(let ([p (collapse-module-path-index
|
(let ([p (collapse-module-path-index
|
||||||
mod
|
mod
|
||||||
(current-directory))])
|
(build-path (current-directory) "dummy"))])
|
||||||
(if (path? p)
|
(if (path? p)
|
||||||
;; If we got a path back anyway, then it's best to use the resolved
|
;; If we got a path back anyway, then it's best to use the resolved
|
||||||
;; name; if the current directory has changed since we
|
;; name; if the current directory has changed since we
|
||||||
|
|
|
@ -45,11 +45,18 @@
|
||||||
|
|
||||||
(define (combine-relative-elements elements)
|
(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:
|
;; Used for 'file paths, so it's platform specific:
|
||||||
(define (attach-to-relative-path relto)
|
(define (attach-to-relative-path relto)
|
||||||
(apply build-path
|
(apply build-path
|
||||||
(let-values ([(base n d?) (split-path relto)])
|
(extract-base relto)
|
||||||
(if (eq? base 'relative) 'same base))
|
|
||||||
(map (lambda (i) (if (bytes? i) (bytes->path i) i))
|
(map (lambda (i) (if (bytes? i) (bytes->path i) i))
|
||||||
elements)))
|
elements)))
|
||||||
|
|
||||||
|
@ -58,8 +65,7 @@
|
||||||
(cond
|
(cond
|
||||||
[(or (path? relto-mp) (and (string? relto-mp) (ormap path? elements)))
|
[(or (path? relto-mp) (and (string? relto-mp) (ormap path? elements)))
|
||||||
(apply build-path
|
(apply build-path
|
||||||
(let-values ([(base name dir?) (split-path relto-mp)])
|
(extract-base relto-mp)
|
||||||
(if (eq? base 'relative) 'same base))
|
|
||||||
(map (lambda (x) (if (bytes? x) (bytes->path x) x))
|
(map (lambda (x) (if (bytes? x) (bytes->path x) x))
|
||||||
elements))]
|
elements))]
|
||||||
[(string? relto-mp)
|
[(string? relto-mp)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user