summaryrefslogtreecommitdiff
path: root/lib/std/pathjoin.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/pathjoin.myr')
-rw-r--r--lib/std/pathjoin.myr13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/std/pathjoin.myr b/lib/std/pathjoin.myr
index eb5e6fd..1b1cf6a 100644
--- a/lib/std/pathjoin.myr
+++ b/lib/std/pathjoin.myr
@@ -2,12 +2,13 @@ use "alloc"
use "extremum"
use "strjoin"
use "strsplit"
-use "sleq"
use "sljoin"
use "sldup"
use "slcp"
use "die"
use "fmt"
+use "traits"
+use "hashfuncs"
pkg std =
const pathcat : (a : byte[:], b : byte[:] -> byte[:])
@@ -45,7 +46,7 @@ const pathnorm = {p
and remove it later on.
*/
for i = 0; i < comps.len; i++
- if sleq(comps[i], ".")
+ if eq(comps[i], ".")
comps[i] = ""
;;
;;
@@ -59,11 +60,11 @@ const pathnorm = {p
get mangled.
*/
for i = 0; i < comps.len; i++
- if !sleq(comps[i], "..")
+ if !eq(comps[i], "..")
continue
;;
for del = 1; del <= i; del++
- if comps[i - del].len > 0 && !sleq(comps[i-del], "..")
+ if comps[i - del].len > 0 && !eq(comps[i-del], "..")
comps[i - del] = ""
comps[i] = ""
break
@@ -85,9 +86,9 @@ const pathnorm = {p
make it absolute. If we have an empty path, return
".". Otherwise, just return the path.
*/
- if p.len > 0 && sleq(p[:1], "/")
+ if p.len > 0 && eq(p[:1], "/")
for i = 0; i < comps.len; i++
- if !sleq(comps[i], "..")
+ if !eq(comps[i], "..")
break
;;
;;