summaryrefslogtreecommitdiff
path: root/libstd
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-04-12 19:38:05 -0700
committerOri Bernstein <ori@eigenstate.org>2015-04-12 19:38:05 -0700
commit642dae20a73cca3ab40127639361af0f72423be8 (patch)
treedf172315866569054ca4442c8096aa8a481b480f /libstd
parentbfa88ef5986d6054bcac17227b95f6dbf42b88db (diff)
downloadmc-642dae20a73cca3ab40127639361af0f72423be8.tar.gz
Now actually fix it.
Diffstat (limited to 'libstd')
-rw-r--r--libstd/pathjoin.myr11
1 files changed, 8 insertions, 3 deletions
diff --git a/libstd/pathjoin.myr b/libstd/pathjoin.myr
index 69d020b..3e05905 100644
--- a/libstd/pathjoin.myr
+++ b/libstd/pathjoin.myr
@@ -1,7 +1,9 @@
use "alloc.use"
+use "extremum.use"
use "strjoin.use"
use "strsplit.use"
use "sleq.use"
+use "sljoin.use"
use "sldup.use"
use "slcp.use"
use "die.use"
@@ -18,11 +20,14 @@ const pathcat = {a, b
}
const pathjoin = {l
- var p, q
+ var p, i, q
- if l.len > 0
- p = strjoin(l, "/")
+ for i = 0; i < l.len; i++
+ if l[i].len != 0
+ break
+ ;;
;;
+ p = strjoin(l[i:], "/")
q = pathnorm(p)
slfree(p)
-> q