Commit 38be99ed authored by Houtan Bastani's avatar Houtan Bastani

replace `filesep` with `/`

On Windows, `filesep` evaluates to `\` and, in a `*printf` statement, this can have unintended consequences (e.g. `\t` evaluates to the tab character

Since '/' works on all systems, replace all occurrences of `filesep` with `/` in the codebase
parent 483c2936
Pipeline #2193 failed with stage
in 56 seconds
......@@ -39,16 +39,16 @@ if ne < 1
return
end
if exist([rep_dir filesep o.graphDirName], 'dir') ~= 7
mkdir([rep_dir filesep o.graphDirName]);
if exist([rep_dir '/' o.graphDirName], 'dir') ~= 7
mkdir([rep_dir '/' o.graphDirName]);
end
if isempty(o.graphName)
graphName = sprintf([o.graphDirName filesep 'graph_pg%d_sec%d_row%d_col%d.tex'], pg, sec, row, col);
graphName = sprintf([o.graphDirName '/graph_pg%d_sec%d_row%d_col%d.tex'], pg, sec, row, col);
else
graphName = [o.graphDirName filesep o.graphName];
graphName = [o.graphDirName '/' o.graphName];
end
[fid, msg] = fopen([rep_dir filesep graphName], 'w');
[fid, msg] = fopen([rep_dir '/' graphName], 'w');
if fid == -1
error(['@graph.writeGraphFile: ' msg]);
end
......
......@@ -42,11 +42,11 @@ end
fprintf(fid, '\n');
if ~isempty(o.latex)
dir = [rep_dir filesep o.pageDirName];
dir = [rep_dir '/' o.pageDirName];
if exist(dir, 'dir') ~= 7
mkdir(dir);
end
pagename = [dir filesep 'page_' num2str(pg) '.tex'];
pagename = [dir '/page_' num2str(pg) '.tex'];
[fidp, msg] = fopen(pagename, 'w');
if fidp == -1
error(['@page.write: ' msg]);
......
......@@ -57,7 +57,7 @@ assert(ischar(opts.compiler), '@report.compile: compiler file must be a string')
assert(islogical(opts.showReport), '@report.compile: showReport must be either true or false');
assert(islogical(opts.showOutput), '@report.compile: showOutput must be either true or false');
if exist([o.directory filesep o.fileName], 'file') ~= 2
if exist([o.directory '/' o.fileName], 'file') ~= 2
o.write();
end
......@@ -111,7 +111,7 @@ if status ~= 0
' ' opts.compiler ' returned the error code: ' num2str(status)]);
end
if o.showOutput || opts.showOutput
fprintf('Done.\n\nYour compiled report is located here:\n %s.pdf\n\n\n', [pwd filesep rfn])
fprintf('Done.\n\nYour compiled report is located here:\n %s.pdf\n\n\n', [pwd '/' rfn])
end
if opts.showReport && ~isoctave
open([rfn '.pdf']);
......
......@@ -31,7 +31,7 @@ function o = write(o)
if exist(o.directory, 'dir') ~= 7
mkdir(o.directory);
end
[fid, msg] = fopen([o.directory filesep o.fileName], 'w');
[fid, msg] = fopen([o.directory '/' o.fileName], 'w');
if fid == -1
error(['@report.write: ' msg]);
end
......
......@@ -40,16 +40,16 @@ if ne == 0 && ~is_data_table
return
end
if exist([rep_dir filesep o.tableDirName], 'dir') ~= 7
mkdir([rep_dir filesep o.tableDirName]);
if exist([rep_dir '/' o.tableDirName], 'dir') ~= 7
mkdir([rep_dir '/' o.tableDirName]);
end
if isempty(o.tableName)
tableName = sprintf([o.tableDirName filesep 'table_pg%d_sec%d_row%d_col%d.tex'], pg, sec, row, col);
tableName = sprintf([o.tableDirName '/table_pg%d_sec%d_row%d_col%d.tex'], pg, sec, row, col);
else
tableName = [o.tableDirName filesep o.tableName];
tableName = [o.tableDirName '/' o.tableName];
end
[fid, msg] = fopen([rep_dir filesep tableName], 'w');
[fid, msg] = fopen([rep_dir '/' tableName], 'w');
if fid == -1
error(['@report_table.writeTableFile: ' msg]);
end
......
......@@ -24,5 +24,5 @@ function initialize_reporting_toolbox()
reporting_src_root = strrep(which('initialize_reporting_toolbox'), 'initialize_reporting_toolbox.m', '');
% Add path to reporting source
addpath([reporting_src_root filesep '..' filesep 'macros']);
addpath([reporting_src_root '/../macros']);
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment