Skip to content

Commit 38e777c

Browse files
BUG: textscan can error out when the outlog is too long, limit to 1000 lines
1 parent 6cd980d commit 38e777c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/m/solve/loadresultsfromdisk.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@
4747
%recover solution_type from results
4848
md.private.solution=structure(1).SolutionType;
4949

50-
%read log files onto fields
50+
%read log files onto fields (only keep the first 1000 lines!)
5151
if exist([md.miscellaneous.name '.errlog'],'file'),
52-
md.results.(structure(1).SolutionType)(1).errlog=char(textread([md.miscellaneous.name '.errlog'],'%s','delimiter','\n'));
52+
md.results.(structure(1).SolutionType)(1).errlog=char(textread([md.miscellaneous.name '.errlog'],'%s',1000,'delimiter','\n'));
5353
else
5454
md.results.(structure(1).SolutionType)(1).errlog='';
5555
end
5656

5757
if exist([md.miscellaneous.name '.outlog'],'file'),
58-
md.results.(structure(1).SolutionType)(1).outlog=char(textread([md.miscellaneous.name '.outlog'],'%s','delimiter','\n'));
58+
md.results.(structure(1).SolutionType)(1).outlog=char(textread([md.miscellaneous.name '.outlog'],'%s',1000,'delimiter','\n'));
5959
else
6060
md.results.(structure(1).SolutionType)(1).outlog='';
6161
end

0 commit comments

Comments
 (0)