Skip to content
Snippets Groups Projects
Verified Commit f363c3da authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Restore behavior of 'nolog' option

The option had been broken by 0e77815e.

This option cannot be entirely handled at the preprocessor level, since the
main log file is created at the MATLAB/Octave level. Handle it via a dedicated
regular expression.
parent 3dcfb986
No related branches found
No related tags found
No related merge requests found
...@@ -259,6 +259,12 @@ no_log = 0; ...@@ -259,6 +259,12 @@ no_log = 0;
for i=1:length(varargin) for i=1:length(varargin)
no_log = no_log || strcmp(varargin{i}, 'nolog'); no_log = no_log || strcmp(varargin{i}, 'nolog');
end end
fid = fopen(fname, 'r');
firstline = fgetl(fid);
fclose(fid);
if ~isempty(regexp(firstline, '//\s*--\+\s*options:(|.*\s|.*,)nolog(|\s.*|,.*)\+--'))
no_log = 1;
end
if ~no_log if ~no_log
logname = [fname(1:end-4) '.log']; logname = [fname(1:end-4) '.log'];
fid = fopen(logname, 'w'); fid = fopen(logname, 'w');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment