Skip to content

Commit af7bc07

Browse files
committed
root: dedupe logic
1 parent 3ed99d9 commit af7bc07

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

+stdlib/root.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
else
1010

1111
r = "";
12+
if ~stdlib.is_absolute(p)
13+
return
14+
end
1215

13-
if startsWith(p, "/")
14-
r = "/";
15-
elseif ispc && strlength(p) >= 2 && isletter(extractBetween(p, 1, 1)) && extractBetween(p, 2, 2) == ":"
16+
if ispc
1617
r = extractBetween(p, 1, 2) + "/";
18+
else
19+
r = "/";
1720
end
1821

1922
end

0 commit comments

Comments
 (0)