Careful when composing simplify-path' and
expand-path'
svn: r4478
This commit is contained in:
parent
c1cc293cd5
commit
9cb8f01a09
|
@ -10,8 +10,10 @@
|
|||
;; best to do some minor normalization. This is similar to what
|
||||
;; "main-collects.ss" does. Again, this makes mzscheme expand paths
|
||||
;; that begin with `~'.
|
||||
;; Note: (expand-path (simplify-path P #f)) is bogus, if P is
|
||||
;; "./~foo" or "~foo/.."
|
||||
(define (system-path* what)
|
||||
(expand-path (simplify-path (find-system-path what) #f)))
|
||||
(simplify-path (expand-path (find-system-path what) #f)))
|
||||
|
||||
;; ----------------------------------------
|
||||
;; "collects"
|
||||
|
|
|
@ -23,8 +23,10 @@
|
|||
;; fine: getting rid of `.' and `..' (simplify-path) and collapsing
|
||||
;; `//' to `/' (expand-path). Using `expand-path' also expands `~'
|
||||
;; and `~user', but this should not be a problem in practice.
|
||||
;; Note: (expand-path (simplify-path P)) is bogus, if P is "./~foo"
|
||||
;; or "~foo/.."
|
||||
(define (simplify-bytes-path bytes)
|
||||
(path->bytes (expand-path (simplify-path (bytes->path bytes)))))
|
||||
(path->bytes (simplify-path (expand-path (bytes->path bytes)))))
|
||||
;; on Windows, turn backslashes to forward slashes
|
||||
(define simplify-path*
|
||||
(if (eq? 'windows (system-type))
|
||||
|
|
Loading…
Reference in New Issue
Block a user