From 503b055df2aacfa38f8f0863dfb60467b6f48f16 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien.villemot@ens.fr>
Date: Mon, 10 Jan 2011 13:11:25 +0100
Subject: [PATCH] Fixed bugs in varlist_indices.m (thanks to Johannes Pfeifer
 for pointing them)

---
 matlab/varlist_indices.m | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/matlab/varlist_indices.m b/matlab/varlist_indices.m
index 5ba0e3cec..a3936cdab 100644
--- a/matlab/varlist_indices.m
+++ b/matlab/varlist_indices.m
@@ -13,7 +13,7 @@ function [i_var,nvar] = varlist_indices(sublist,list)
 % SPECIAL REQUIREMENTS
 %    none
 
-% Copyright (C) 2010 Dynare Team
+% Copyright (C) 2010-2011 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -37,7 +37,7 @@ else
     check = [];
     i_var = [];
     for i = 1:rows(sublist)
-        tmp = strmatch(sublist(i,:), list, 'exact');
+        tmp = strmatch(deblank(sublist(i,:)), list, 'exact');
         if isempty(tmp)
             check = [ check; 0 ];
         else
@@ -50,7 +50,10 @@ end
 nvar = length(i_var);
 
 if ~all(check)
-    k =find(check);
-    error(strcat(sublist(k,:),' hasn''t been declared'))
+    k = find(~check);
+    tempstring = 'The following symbols are not endogenous variables: ';
+    for ii = 1:length(k)
+        tempstring = [ tempstring, deblank(sublist(k(ii),:)), ' ' ];
+    end
+    error(tempstring)
 end
-
-- 
GitLab