add workaround for handline include files

This commit is contained in:
Axel Kohlmeyer
2019-06-23 16:47:12 -04:00
parent e42e1e64a8
commit 36649f0534
2 changed files with 8 additions and 0 deletions

View File

@ -77,6 +77,7 @@ Input::Input(LAMMPS *lmp, int argc, char **argv) : Pointers(lmp)
echo_screen = 0; echo_screen = 0;
echo_log = 1; echo_log = 1;
eof_return = 0;
label_active = 0; label_active = 0;
labelstr = NULL; labelstr = NULL;
@ -205,6 +206,7 @@ void Input::file()
MPI_Bcast(&n,1,MPI_INT,0,world); MPI_Bcast(&n,1,MPI_INT,0,world);
if (n == 0) { if (n == 0) {
if (label_active) error->all(FLERR,"Label wasn't found in input script"); if (label_active) error->all(FLERR,"Label wasn't found in input script");
if (eof_return) break;
if (me == 0) { if (me == 0) {
if (infile != stdin) { if (infile != stdin) {
fclose(infile); fclose(infile);
@ -1051,6 +1053,11 @@ void Input::include()
error->one(FLERR,str); error->one(FLERR,str);
} }
infiles[nfile++] = infile; infiles[nfile++] = infile;
eof_return = 1;
file();
eof_return = 0;
nfile--;
infile = infiles[nfile-1];
} }
} }

View File

@ -46,6 +46,7 @@ class Input : protected Pointers {
char *command; // ptr to current command char *command; // ptr to current command
int echo_screen; // 0 = no, 1 = yes int echo_screen; // 0 = no, 1 = yes
int echo_log; // 0 = no, 1 = yes int echo_log; // 0 = no, 1 = yes
int eof_return; // if 1: at EOF return from parsing in file()
private: private:
int me; // proc ID int me; // proc ID