Skip to content

Commit

Permalink
absolute('') = ''
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Feb 29, 2024
1 parent 8945e7c commit df3c02a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion +stdlib/+fileio/absolute_path.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
% have to expand ~ first (like C++ filesystem::path::absolute)
abspath = stdlib.fileio.expanduser(p);

if isempty(abspath)
if isempty(abspath) || abspath == ""
return
end

Expand Down
2 changes: 1 addition & 1 deletion test/TestFilePure.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function test_absolute_path(tc)
import matlab.unittest.constraints.StartsWithSubstring

tc.verifyEmpty(stdlib.absolute_path(string.empty))
tc.verifyEqual(stdlib.absolute_path(""), string(pwd))
tc.verifyEqual(stdlib.absolute_path(""), "")

pabs = stdlib.absolute_path('2foo');
pabs2 = stdlib.absolute_path('4foo');
Expand Down

0 comments on commit df3c02a

Please sign in to comment.