Skip to content

Commit c3434a1

Browse files
committed
join: remove drop_slash
1 parent 7ffc10f commit c3434a1

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

+stdlib/join.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
end
88

99

10-
b = stdlib.drop_slash(base);
11-
o = stdlib.drop_slash(other);
10+
b = stdlib.posix(base);
11+
o = stdlib.posix(other);
1212

13-
if strncmp(o, "/", 1) || (ispc && stdlib.is_absolute(o))
13+
if startsWith(o, "/") || (ispc && stdlib.is_absolute(o))
1414
p = o;
1515
return
1616
end

test/TestJoin.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
p = {{"", "", ""}, ...
55
{"a", "", "a"}, ...
66
{"", "a", "a"}, ...
7-
{"a/b/", "c/", "a/b/c"}, ...
7+
{"a/b/", "c", "a/b/c"}, ...
88
{"/", "", "/"}, ...
99
{"", "/", "/"}, ...
10-
{"a", "b//", "a/b"}, ...
11-
{"a//", "b//", "a/b"}, ...
12-
{"a/b/../", "c/d/../", "a/b/../c/d/.."}, ...
10+
{"a", "b", "a/b"}, ...
11+
{"a/b/../", "c/d/..", "a/b/../c/d/.."}, ...
1312
{"a/b", "..", "a/b/.."}, ...
1413
{"a/b", "c/d", "a/b/c/d"}, ...
1514
{"ab/cd", "/ef", "/ef"}, ...

test/TestWithSuffix.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{"c", "", "c"}, ...
66
{"c.nc", "", "c"}, ...
77
{"", ".nc", ".nc"}, ...
8-
{"a//b///c///", ".h5", "a/b/c/.h5"}, ...
8+
{"a/b/c/", ".h5", "a/b/c/.h5"}, ...
99
{"a/b/.h5", ".nc", "a/b/.h5.nc"}, ...
1010
{"a/b", ".nc", "a/b.nc"}
1111
};

0 commit comments

Comments
 (0)