Skip to content

Commit 2a0a6ec

Browse files
committed
canonical: if not JVM, return original non-existant path
1 parent 8481346 commit 2a0a6ec

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

+stdlib/canonical.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,14 @@
3232
return
3333
end
3434

35+
e = stdlib.exists(c);
36+
if ~e && ~stdlib.has_java
37+
% _canonicalizepath errors if path does not exist
38+
return
39+
end
40+
3541
if ~stdlib.is_absolute(c)
36-
if stdlib.exists(c)
42+
if e
3743
% workaround Java/Matlab limitations
3844
c = stdlib.join(pwd, c);
3945
else
@@ -49,7 +55,6 @@
4955
c = java.io.File(c).getCanonicalPath();
5056
else
5157
% similar benchmark time as java method
52-
% REQUIRES path to exist, while java method does not.
5358
c = builtin('_canonicalizepath', c);
5459
end
5560

0 commit comments

Comments
 (0)