Skip to content

Commit 5213bb5

Browse files
committed
more strncmp simplify
1 parent 63d4e1a commit 5213bb5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

+stdlib/canonical.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
return
3232
end
3333

34-
if ispc && startsWith(c, "\\")
34+
if ispc && strncmp(c, "\\", 2)
3535
% UNC path is not canonicalized
3636
return
3737
end

+stdlib/normalize.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
% use split to remove /../ and /./ and duplicated /
2626
parts = split(n, '/');
2727
i0 = 1;
28-
if startsWith(n, "/")
28+
if strncmp(n, "/", 1)
2929
n = "/";
3030
elseif ispc && strlength(n) >= 2 && strlength(stdlib.root_name(p))
3131
n = parts(1);

0 commit comments

Comments
 (0)