File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 99
1010function exe = which(cmd , fpath , find_all )
1111arguments
12- cmd { mustBeTextScalar }
12+ cmd ( 1 , 1 ) string
1313 fpath (1 ,: ) string = string.empty
1414 find_all (1 ,1 ) logical = false
1515end
1616
17- if find_all
18- exe = string .empty ;
19- else
20- exe = ' ' ;
21- end
17+ exe = string .empty ;
2218
2319%% on Windows, append .exe if not suffix is given
2420if ispc() && strempty(stdlib .suffix(cmd ))
25- cmd = strcat( cmd , ' .exe' ) ;
21+ cmd = cmd + " .exe" ;
2622end
2723%% full filename was given
28- if isfile(cmd ) && stdlib .is_exe(cmd )
24+ if stdlib .is_exe(cmd )
25+ % is_exe implies isfile
2926 exe = cmd ;
3027 return
3128end
6562end
6663
6764end
68-
69- % !assert(~isempty(which("octave", [], false)))
Original file line number Diff line number Diff line change 22
33properties (TestParameter )
44mexe = {matlabroot + " /bin/matlab" , ...
5- fullfile (matlabroot, 'bin', ' matlab')}
5+ fullfile (matlabroot, 'bin/ matlab')}
66end
77
88methods (Test , TestTags = " impure" )
@@ -33,9 +33,9 @@ function test_which_name(tc)
3333
3434function test_which_absolute(tc , mexe )
3535
36- r = mexe ;
36+ r = string( mexe ) ;
3737if ispc()
38- r = strcat( r , ' .exe' ) ;
38+ r = r + " .exe" ;
3939end
4040
4141tc .verifyEqual(stdlib .which(mexe ), r )
You can’t perform that action at this time.
0 commit comments