summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-10-11 11:07:31 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-10-11 11:07:31 -0700
commit2034e70be87fa1635b7e5a445450c1777c16d2ba (patch)
tree1abf675e10c128652b3289d9e2dcbc686c9db9fb /stdlib
parent29fa05a92575322919bdd783d45d14a74d30e226 (diff)
downloadtxr-2034e70be87fa1635b7e5a445450c1777c16d2ba.tar.gz
txr-2034e70be87fa1635b7e5a445450c1777c16d2ba.tar.bz2
txr-2034e70be87fa1635b7e5a445450c1777c16d2ba.zip
path-equal: propagate fixes from rel-path.
* stdlib/copy-file.tl (path-equal): This function is based on rel-path and so suffers the same bugs. Retarget it to use the new functions and approach to volumes from rel-path, so it benefits from the fixes.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/copy-file.tl22
1 files changed, 10 insertions, 12 deletions
diff --git a/stdlib/copy-file.tl b/stdlib/copy-file.tl
index 4e509538..5c87b10f 100644
--- a/stdlib/copy-file.tl
+++ b/stdlib/copy-file.tl
@@ -282,15 +282,13 @@
[path-sep-chars 0])))))))
(defun path-equal (left right)
- (cond
- ((and (stringp left) (equal left right)))
- ((neq (abs-path-p left) (abs-path-p right)) nil)
- ((and (macro-time (find #\\ path-sep-chars))
- (if-match `@{fdrv #/[A-Za-z0-9]+:/}@nil` left
- (if-match `@{tdrv #/[A-Za-z0-9]+:/}@nil` right
- (nequal fdrv tdrv))))
- nil)
- (t (let* ((fcomp (path-simplify (spl path-sep-chars left)))
- (tcomp (path-simplify (spl path-sep-chars right)))
- (ncommon (mismatch fcomp tcomp)))
- (null ncommon)))))
+ (if (and (stringp left) (equal left right))
+ t
+ (let* ((lspl (path-split left))
+ (rspl (path-split right))
+ (lvol (path-volume lspl))
+ (rvol (path-volume rspl)))
+ (if (nequal lvol rvol)
+ nil
+ (equal (path-simplify lspl)
+ (path-simplify rspl))))))