Skip to content

Commit f1d28b3

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

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

+stdlib/posix.m

Lines changed: 4 additions & 4 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
77
p 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)