From ec9f755c273f53c9edbce3f7c8a51dfa95aba4ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Thu, 29 Jun 2017 22:10:06 +0200 Subject: [PATCH] Raise an error if file name given to dynare ends with a period. --- matlab/dynare.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/matlab/dynare.m b/matlab/dynare.m index 71fe13907..5517846fb 100644 --- a/matlab/dynare.m +++ b/matlab/dynare.m @@ -97,6 +97,10 @@ if length(dot_location)>1 error('DYNARE: Periods in filenames are only allowed for .mod or .dyn extensions') end +if dot_location==length(fname) + error('DYNARE: Periods in filenames are only allowed for .mod or .dyn extensions') +end + % Add dyn or mod extension to the file name if not already provided. if isempty(strfind(fname,'.')) fnamelength = length(fname);