Skip to content

Commit 72c8c7e

Browse files
committed
posix: avoid duplicate coerce
1 parent a09f846 commit 72c8c7e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

+stdlib/posix.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
% convert a path to a Posix string path separated with "/" even on Windows.
33
% If Windows path also have escaping "\" this breaks
44

5-
function p = posix(p)
5+
function r = posix(p)
66
arguments
7-
p string
7+
p (1,1) string
88
end
99

10-
p = string(p);
11-
1210
if ispc
13-
p = strrep(p, "\", "/");
11+
r = strrep(p, "\", "/");
12+
else
13+
r = p;
1414
end
1515

1616
end

0 commit comments

Comments
 (0)