Skip to content

Commit 62f204c

Browse files
committed
matlab < R2020b compatibility
1 parent 63db420 commit 62f204c

File tree

11 files changed

+25
-16
lines changed

11 files changed

+25
-16
lines changed

+stdlib/+legacy/file_attributes.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
function a = file_attributes(p)
2+
arguments
3+
p (1,1) string
4+
end
5+
% need arguments for Matlab < R2020b
26

37
assert(strlength(p), 'Path must not be empty.')
48

+stdlib/+native/has_windows_executable_suffix.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
end
1010
pe = split(string(pec), pathsep);
1111

12-
i = endsWith(stdlib.suffix(p), pe, IgnoreCase=true);
12+
i = endsWith(stdlib.suffix(p), pe, 'IgnoreCase', true);
1313

1414
end

+stdlib/+python/is_mount.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
if ~p.exists(), return, end
1414

1515
% some Python on CI needs this. Didn't replicate on local Windows PC.
16-
if ispc() && strcmp(filepath, string(p.drive)) && ~endsWith(filepath, "/" | filesep)
16+
if ispc() && strcmp(filepath, string(p.drive)) && ~endsWith(filepath, ["/", filesep])
1717
y = false;
1818
return
1919
end

+stdlib/+sys/is_mount.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
if ispc()
1111
if ismember(filepath, ["/", "\"]) || ...
12-
(endsWith(filepath, "/" | filesep) && isfolder(filepath) && filepath == stdlib.root(filepath))
12+
(endsWith(filepath, ["/", filesep]) && isfolder(filepath) && filepath == stdlib.root(filepath))
1313
y = true;
1414
return
1515
end

+stdlib/ini2struct.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
function i = is_comment(line)
5353
% a comment line detected
5454

55-
i = isempty(line) || startsWith(line, ";" | "#");
55+
i = isempty(line) || startsWith(line, [";", "#"]);
5656

5757
end
5858

+stdlib/join.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
elseif ~stdlib.strempty(rdo)
1818

1919
if ~stdlib.strempty(rnb)
20-
if endsWith(rnb, "/" | filesep)
20+
if endsWith(rnb, ["/", filesep])
2121
p = rnb + other;
2222
else
2323
p = rnb + "/" + other;
@@ -29,7 +29,7 @@
2929
elseif ~stdlib.strempty(base)
3030

3131
if ~stdlib.strempty(other)
32-
if endsWith(base, "/" | filesep)
32+
if endsWith(base, ["/", filesep])
3333
p = base + other;
3434
else
3535
p = base + "/" + other;

+stdlib/normalize.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
parts = split(apath, ["/", filesep]);
1717
i0 = 1;
18-
if startsWith(apath, "/" | filesep)
18+
if startsWith(apath, ["/", filesep])
1919
n = extractBefore(apath, 2);
2020
elseif ispc() && strlength(apath) >= 2 && ~stdlib.strempty(stdlib.root_name(apath))
2121
n = parts(1);

+stdlib/root_dir.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
r = repmat("", size(p));
1717

18-
i = startsWith(p, "/" | filesep);
18+
i = startsWith(p, ["/", filesep]);
1919
r(i) = extractBefore(p(i), 2);
2020

2121
if ispc()

+stdlib/subprocess_run.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838

3939

4040
if ~stdlib.strempty(opt.cwd)
41-
mustBeFolder(opt.cwd)
41+
assert(isfolder(opt.cwd), opt.cwd + " is not a folder")
42+
4243
cmd = join(["cd", opt.cwd, "&&", cmd]);
4344
end
4445

+stdlib/which.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
for p = fpath
4545
if stdlib.strempty(p), continue, end
4646

47-
if endsWith(p, "/" | filesep)
47+
if endsWith(p, ["/", filesep])
4848
e = p + cmd;
4949
else
5050
e = p + "/" + cmd;

0 commit comments

Comments
 (0)