Skip to content

Commit 91b145b

Browse files
committed
which: remove unused arg
1 parent 685fe9b commit 91b145b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

+stdlib/+fileio/which.m

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
function exe = which(name, fpath, subdir)
1+
function exe = which(name, fpath)
22
% fileio.which Find executable with name under path
33
% like Python shutil.which, may return relative or absolute path
44

55
arguments
66
name (1,1) string {mustBeNonzeroLengthText}
77
fpath (1,:) string = getenv('PATH')
8-
subdir (1,:) string {mustBeNonempty} = ""
98
end
109

1110
import stdlib.fileio.is_exe
@@ -37,11 +36,9 @@
3736
end
3837

3938
for p = fpath
40-
for s = subdir
41-
exe = fullfile(p, s, name);
42-
if is_exe(exe)
43-
return
44-
end
39+
exe = fullfile(p, name);
40+
if is_exe(exe)
41+
return
4542
end
4643
end
4744

0 commit comments

Comments
 (0)