Skip to content

Commit 2214ac9

Browse files
committed
normalize: dedupe
1 parent 33b15fb commit 2214ac9

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

+stdlib/normalize.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
i0 = 1;
2626
if startsWith(n, "/")
2727
n = "/";
28-
elseif ispc && strlength(n) >= 2 && isletter(extractBetween(n, 1, 1)) && extractBetween(n, 2, 2) == ":"
28+
elseif ispc && strlength(n) >= 2 && strlength(stdlib.root_name(p))
2929
n = parts(1);
3030
i0 = 2;
3131
else

+stdlib/version_atleast.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@
99
% * r: logical
1010

1111
function r = version_atleast(in, ref)
12-
1312
arguments
1413
in (1,1) string
1514
ref (1,1) string
1615
end
1716

17+
if stdlib.isoctave()
18+
r = compare_versions(in, ref, '>=');
19+
return
20+
end
21+
1822
in = split(in, ' ');
1923
in = split(in(1), '.');
2024

@@ -32,4 +36,6 @@
3236

3337
r = in(end) >= ref(end);
3438

35-
end % function
39+
end
40+
41+
%!assert(version_atleast("1.2.3", "1.2"))

0 commit comments

Comments
 (0)