Skip to content
Snippets Groups Projects
Commit 40a60e92 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Fixed bug when loaded m file data is not in the current folder or a subfoler.

parent 11f00d04
No related merge requests found
......@@ -19,6 +19,10 @@ function b = check_file_extension(file,type)
% AUTHOR(S) stephane DOT adjemian AT univ DASH lemans DOT fr
% Clean-up path
file = strrep(file, '../', '');
file = strrep(file, './', '');
remain = file;
while ~isempty(remain)
[ext, remain] = strtok(remain,'.');
......
......@@ -28,6 +28,10 @@ function ext = get_file_extension(file)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% Clean-up path
file = strrep(file, '../', '');
file = strrep(file, './', '');
remain = file;
while ~isempty(remain)
[ext, remain] = strtok(remain,'.');
......
......@@ -36,7 +36,7 @@ function [freq,init,data,varlist,tex] = load_m_file_data(file)
if isoctave
run(file);
else
[basename, ext] = strtok(file,'.');
basename = file(1:end-2);
run(basename);
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment