From c25a8ad4263bcad93150648b7df9edd22f738900 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Sat, 23 Jan 2010 23:20:49 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3743 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/input.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/input.cpp b/src/input.cpp index 29dc160168..5ffa2e8496 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -546,6 +546,9 @@ void Input::ifthenelse() int iarg,first,last; + // identify range of commands within arg list for then or else + // for else, if no comands, just return + if (strcmp(arg[3],"then") != 0) error->all("Illegal if command"); if (flag) { iarg = first = 4; @@ -554,7 +557,7 @@ void Input::ifthenelse() } else { iarg = 4; while (iarg < narg && strcmp(arg[iarg],"else") != 0) iarg++; - if (iarg == narg) error->all("Illegal if command"); + if (iarg == narg) return; first = iarg+1; last = narg-1; }