parent
07c7ff51ff
commit
a3bf702ac9
|
@ -944,6 +944,8 @@
|
|||
(test (bytes->path #"../") simplify-path (bytes->path #"../") #f)
|
||||
(test (bytes->path #"../") simplify-path (bytes->path #"..//") #f)
|
||||
(test (bytes->path #"../") simplify-path (bytes->path #"..//./") #f)
|
||||
(test (bytes->path #"/x") simplify-path (bytes->path #"/../../x") #f)
|
||||
(test (bytes->path #"/") simplify-path (bytes->path #"/x/../..") #f)
|
||||
(test (bytes->path #"x/") path->directory-path (bytes->path #"x"))
|
||||
(test (bytes->path #"x/") path->directory-path (bytes->path #"x/"))
|
||||
(test (bytes->path #"x/./") path->directory-path (bytes->path #"x/."))
|
||||
|
|
|
@ -25003,11 +25003,20 @@
|
|||
accum_0)
|
||||
(if (eq? 'up (car l_1))
|
||||
(if (pair? accum_0)
|
||||
(let ((app_0
|
||||
(cdr l_1)))
|
||||
(if (if (null?
|
||||
(cdr
|
||||
accum_0))
|
||||
(1/absolute-path?
|
||||
(car accum_0))
|
||||
#f)
|
||||
(loop_0
|
||||
app_0
|
||||
(cdr accum_0)))
|
||||
(cdr l_1)
|
||||
accum_0)
|
||||
(let ((app_0
|
||||
(cdr l_1)))
|
||||
(loop_0
|
||||
app_0
|
||||
(cdr accum_0))))
|
||||
(cons
|
||||
'up
|
||||
(loop_0
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
"directory-path.rkt"
|
||||
"complete.rkt"
|
||||
"parameter.rkt"
|
||||
"windows.rkt")
|
||||
"windows.rkt"
|
||||
"relativity.rkt")
|
||||
|
||||
(provide simplify-path-syntactically)
|
||||
|
||||
|
@ -52,7 +53,13 @@
|
|||
[(eq? 'up (car l))
|
||||
(cond
|
||||
[(pair? accum)
|
||||
(loop (cdr l) (cdr accum))]
|
||||
(cond
|
||||
[(and (null? (cdr accum))
|
||||
(absolute-path? (car accum)))
|
||||
;; for 'up at root, just keep the root
|
||||
(loop (cdr l) accum)]
|
||||
[else
|
||||
(loop (cdr l) (cdr accum))])]
|
||||
[else
|
||||
(cons 'up (loop (cdr l) null))])]
|
||||
[else (loop (cdr l) (cons (car l) accum))])))
|
||||
|
|
Loading…
Reference in New Issue
Block a user