simplify check for ‘.’ in name

time-shift
Houtan Bastani 2017-09-08 14:57:53 +02:00
parent c026113314
commit a302b7af99
1 changed files with 1 additions and 5 deletions

View File

@ -99,11 +99,7 @@ end
% Testing if filename has more than one period (not allowed).
dot_location=(strfind(fname,'.'));
if length(dot_location)>1
error('DYNARE: Periods in filenames are only allowed for .mod or .dyn extensions')
end
if dot_location==length(fname)
if length(dot_location) > 1 || dot_location == length(fname)
error('DYNARE: Periods in filenames are only allowed for .mod or .dyn extensions')
end