From 0f971bf07caa346222d842a78f42f71eb68a0926 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 6 Nov 2017 10:41:32 -0500 Subject: [PATCH] print name of unknown or incorrect variable in error message --- src/input.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 23b89d3040..3d287771b8 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -530,8 +530,11 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) value = variable->retrieve(var); } - if (value == NULL) error->one(FLERR,"Substitution for illegal variable"); - + if (value == NULL) { + char str[128]; + sprintf(str,"Substitution for illegal variable %s",var); + error->one(FLERR,str); + } // check if storage in str2 needs to be expanded // re-initialize ptr and ptr2 to the point beyond the variable.