Merge pull request #1544 from akohlmey/collected-small-fixes

Collected small changes and bugfixes for the next patch release
This commit is contained in:
Axel Kohlmeyer
2019-07-05 20:33:55 -04:00
committed by GitHub
31 changed files with 40 additions and 53 deletions

View File

@ -82,7 +82,6 @@ Input::Input(LAMMPS *lmp, int argc, char **argv) : Pointers(lmp)
label_active = 0;
labelstr = NULL;
jump_skip = 0;
ifthenelse_flag = 0;
if (me == 0) {
nfile = 1;
@ -959,11 +958,10 @@ void Input::ifthenelse()
ncommands++;
}
ifthenelse_flag = 1;
for (int i = 0; i < ncommands; i++) one(commands[i]);
ifthenelse_flag = 0;
for (int i = 0; i < ncommands; i++) delete [] commands[i];
for (int i = 0; i < ncommands; i++) {
one(commands[i]);
delete [] commands[i];
}
delete [] commands;
return;
@ -1015,13 +1013,10 @@ void Input::ifthenelse()
// execute the list of commands
ifthenelse_flag = 1;
for (int i = 0; i < ncommands; i++) one(commands[i]);
ifthenelse_flag = 0;
// clean up
for (int i = 0; i < ncommands; i++) delete [] commands[i];
for (int i = 0; i < ncommands; i++) {
one(commands[i]);
delete [] commands[i];
}
delete [] commands;
return;
@ -1034,13 +1029,6 @@ void Input::include()
{
if (narg != 1) error->all(FLERR,"Illegal include command");
// do not allow include inside an if command
// NOTE: this check will fail if a 2nd if command was inside the if command
// and came before the include
if (ifthenelse_flag)
error->all(FLERR,"Cannot use include command within an if command");
if (me == 0) {
if (nfile == maxfile)
error->one(FLERR,"Too many nested levels of input scripts");