Skip to content

Commit d62918a

Browse files
committed
{get,set}env single quotes for < R2018a
1 parent 816ae50 commit d62918a

20 files changed

+60
-63
lines changed

+stdlib/cpu_arch.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
function a = cpu_arch()
1313

1414
if ispc()
15-
a = getenv("PROCESSOR_ARCHITECTURE");
15+
a = getenv('PROCESSOR_ARCHITECTURE');
1616
else
1717
[~, a] = system('uname -m');
1818
a = deblank(a);

+stdlib/get_shell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
if r == 0
2020
s = deblank(msg);
2121
else
22-
s = getenv("SHELL");
22+
s = getenv('SHELL');
2323
end
2424

2525
end

+stdlib/homedir.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
function h = homedir()
44

55
if ispc()
6-
h = getenv("USERPROFILE");
6+
h = getenv('USERPROFILE');
77
else
8-
h = getenv("HOME");
8+
h = getenv('HOME');
99
end
1010

1111
end

+stdlib/java_run.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@
6969
% Matlab grabs the stdout, stderr, stdin handles of a Gfortran program, even when it's using Java.
7070
% We must disable this behavior for the duration the running process.
7171

72-
outold = getenv("GFORTRAN_STDOUT_UNIT");
73-
setenv("GFORTRAN_STDOUT_UNIT", "6");
74-
errold = getenv("GFORTRAN_STDERR_UNIT");
75-
setenv("GFORTRAN_STDERR_UNIT", "0");
76-
inold = getenv("GFORTRAN_STDIN_UNIT");
77-
setenv("GFORTRAN_STDIN_UNIT", "5");
72+
outold = getenv('GFORTRAN_STDOUT_UNIT');
73+
setenv('GFORTRAN_STDOUT_UNIT', '6');
74+
errold = getenv('GFORTRAN_STDERR_UNIT');
75+
setenv('GFORTRAN_STDERR_UNIT', '0');
76+
inold = getenv('GFORTRAN_STDIN_UNIT');
77+
setenv('GFORTRAN_STDIN_UNIT', '5');
7878
%% start process
7979
% https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/ProcessBuilder.html#start()
8080
h = proc.start();
@@ -126,9 +126,9 @@
126126
%% close process and restore Gfortran streams
127127
h.destroy()
128128

129-
setenv("GFORTRAN_STDOUT_UNIT", outold);
130-
setenv("GFORTRAN_STDERR_UNIT", errold);
131-
setenv("GFORTRAN_STDIN_UNIT", inold);
129+
setenv('GFORTRAN_STDOUT_UNIT', outold);
130+
setenv('GFORTRAN_STDERR_UNIT', errold);
131+
setenv('GFORTRAN_STDIN_UNIT', inold);
132132

133133
if nargout < 2 && opt.stdout && ~stdlib.strempty(stdout)
134134
disp(stdout)

+stdlib/private/has_windows_executable_suffix.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function i = has_windows_executable_suffix(file)
22

3-
pec = getenv("PATHEXT");
3+
pec = getenv('PATHEXT');
44
if isempty(pec)
55
pec = '.COM;.EXE;.BAT;.CMD;';
66
end

+stdlib/subprocess_run.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,22 @@
7777
% Matlab grabs the stdout, stderr, stdin handles of a Gfortran program, even when it's using Java.
7878
% We must disable this behavior for the duration the running process.
7979

80-
outold = getenv("GFORTRAN_STDOUT_UNIT");
81-
setenv("GFORTRAN_STDOUT_UNIT", "6");
82-
errold = getenv("GFORTRAN_STDERR_UNIT");
83-
setenv("GFORTRAN_STDERR_UNIT", "0");
84-
inold = getenv("GFORTRAN_STDIN_UNIT");
85-
setenv("GFORTRAN_STDIN_UNIT", "5");
80+
outold = getenv('GFORTRAN_STDOUT_UNIT');
81+
setenv('GFORTRAN_STDOUT_UNIT', '6');
82+
errold = getenv('GFORTRAN_STDERR_UNIT');
83+
setenv('GFORTRAN_STDERR_UNIT', '0');
84+
inold = getenv('GFORTRAN_STDIN_UNIT');
85+
setenv('GFORTRAN_STDIN_UNIT', '5');
8686

8787
if opt.echo
8888
disp(cmd)
8989
end
9090

9191
[status, msg] = system(join(cmd), env_pairs{:});
9292

93-
setenv("GFORTRAN_STDOUT_UNIT", outold);
94-
setenv("GFORTRAN_STDERR_UNIT", errold);
95-
setenv("GFORTRAN_STDIN_UNIT", inold);
93+
setenv('GFORTRAN_STDOUT_UNIT', outold);
94+
setenv('GFORTRAN_STDERR_UNIT', errold);
95+
setenv('GFORTRAN_STDIN_UNIT', inold);
9696

9797
msg = deblank(msg);
9898

+stdlib/which.m

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

3535
% path given
3636
if stdlib.strempty(fpath)
37-
fpath = string(getenv("PATH"));
37+
fpath = string(getenv('PATH'));
3838
end
3939

4040
if isscalar(fpath)

example/TestWindowsCOM.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function test_not(tc, Pn)
1313

1414
function test_short_folder(tc)
1515

16-
progdir = getenv("PROGRAMFILES");
16+
progdir = getenv('PROGRAMFILES');
1717
if ispc()
1818
tc.assertThat(progdir, matlab.unittest.constraints.IsFolder, "$Env:PROGRAMFILES is not a directory")
1919
end

find_compiler.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
elseif ispc()
1717
p = getenv('CMPLR_ROOT');
1818
if isempty(p)
19-
p = getenv("MW_MINGW64_LOC");
19+
p = getenv('MW_MINGW64_LOC');
2020
end
2121
if isempty(p)
22-
p = getenv("MINGWROOT");
22+
p = getenv('MINGWROOT');
2323
end
2424
if ~endsWith(p, "bin" | "bin/")
2525
p = p + "/bin";

private/get_compiler.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111

1212
if isempty(co)
1313
switch lang
14-
case "fortran"
15-
comp = getenv("FC");
14+
case 'fortran'
15+
comp = getenv('FC');
1616
if isempty(comp)
1717
disp("set FC environment variable to the Fortran compiler path via get_compiler('fortran'), or do 'mex -setup Fortran")
1818
end
19-
case "c++"
20-
comp = getenv("CXX");
19+
case 'c++'
20+
comp = getenv('CXX');
2121
if isempty(comp)
2222
disp("set CXX environment variable to the C++ compiler path via get_compiler('c++'), or do 'mex -setup c++")
2323
end
24-
case "c"
25-
comp = getenv("CC");
24+
case 'c'
25+
comp = getenv('CC');
2626
if isempty(comp)
2727
disp("set CC environment variable to the C compiler path via get_compiler('c'), or do 'mex -setup c'")
2828
end

0 commit comments

Comments
 (0)