diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-10-20 21:54:57 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-10-20 21:54:57 -0700 |
commit | 180254e6f6124a59d5d2f068eae2848fe1e460ef (patch) | |
tree | d7558bc061d6d7f51fc37fb02fec56b1a1040b11 /stdlib | |
parent | 8470998547f1d3ad33795b0f99ad4507f107e6bd (diff) | |
download | txr-180254e6f6124a59d5d2f068eae2848fe1e460ef.tar.gz txr-180254e6f6124a59d5d2f068eae2848fe1e460ef.tar.bz2 txr-180254e6f6124a59d5d2f068eae2848fe1e460ef.zip |
path-equal: enable and fix failing tests.
* stdlib/copy-file.tl (path-simplify): If the incoming path's
first component is "", it is absolute; in that case swallow
any components that go above.
* tests/018/path-equal.tl: Uncomment two previously failing
tests.
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/copy-file.tl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/stdlib/copy-file.tl b/stdlib/copy-file.tl index 5c87b10f..258192fc 100644 --- a/stdlib/copy-file.tl +++ b/stdlib/copy-file.tl @@ -214,10 +214,11 @@ (utimes s 0 nil 0 t)))) (defun path-simplify (comp) - (let (out) + (let ((abs (equal (car comp) "")) + out) (each ((c comp)) (casequal c - (".." (if (and out (nequal (car out) "..")) + (".." (if (and (or out abs) (nequal (car out) "..")) (pop out) (push c out))) (("." "")) |