Skip to content

Commit 29c3c1e

Browse files
committed
corrections/simplify
1 parent 5717d80 commit 29c3c1e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

+stdlib/subprocess_run_octave.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,13 @@
119119
msg = '';
120120
while ~isempty(line)
121121
msg = strcat(msg, line, newline);
122-
123122
line = reader.readLine();
124123
end
125124

126-
if strlength(msg) > 0 && msg(end) == newline
127-
msg(end) = [];
128-
end
125+
msg = strtrim(msg);
129126

130127
reader.close();
128+
stream.close();
131129

132130
end
133131

@@ -157,7 +155,9 @@
157155
%! end
158156
%!test
159157
%! c = "../test/sleep.exe";
158+
%! if isfile(c)
160159
%! [r, m, e] = subprocess_run_octave(c, [], [], [], 1);
161160
%! assert(r == -1)
162161
%! assert(length(m) == 0)
163162
%! assert(strncmp(e, 'Subprocess timeout', 17))
163+
%! end

0 commit comments

Comments
 (0)