From a3e7547857151eb364f50e9daa0dd22ed7c99c68 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Wed, 16 Jan 2019 11:34:52 +0100
Subject: [PATCH] fix bug when defining variable with value on the command line
 with -D option (problem introduced in
 ee5fc6b16b9a199eaf58210e21def4d254799988)

---
 src/DynareMain.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/DynareMain.cc b/src/DynareMain.cc
index 599dbf86..a361f5d5 100644
--- a/src/DynareMain.cc
+++ b/src/DynareMain.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2018 Dynare Team
+ * Copyright (C) 2003-2019 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -269,7 +269,7 @@ main(int argc, char **argv)
 
           auto equal_index = s.find('=');
           if (equal_index != string::npos)
-            defines[s.substr(2, equal_index)] = s.substr(equal_index+1);
+            defines[s.substr(2, equal_index-2)] = s.substr(equal_index+1);
           else
             defines[s.substr(2)] = "1";
         }
-- 
GitLab