From 3859ea0de063fa31626e19b63cab43cbb7694b6a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stepan@adjemian.eu>
Date: Fri, 26 Feb 2021 17:41:59 +0100
Subject: [PATCH] Fix read_key_value_string if commas are followed by spaces.

---
 matlab/read_key_value_string.m | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/matlab/read_key_value_string.m b/matlab/read_key_value_string.m
index 446afd2f54..c66bc7d500 100644
--- a/matlab/read_key_value_string.m
+++ b/matlab/read_key_value_string.m
@@ -4,7 +4,7 @@ function c = read_key_value_string(s)
 % estimation command) into a cell (first column for the option name ans second column for the
 % option value).
 
-% Copyright (C) 2011-2017 Dynare Team
+% Copyright © 2011-2021 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -21,6 +21,9 @@ function c = read_key_value_string(s)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
+% Remove unnecessary spaces after commas.
+s = regexprep(s, ',\s*', ',');
+
 i_opening_bracket = strfind(s,'(');
 i_closing_bracket = strfind(s,')');
 
-- 
GitLab