git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13601 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2015-07-15 21:29:44 +00:00
parent 062a3575b6
commit f7bc08d83d
22 changed files with 166 additions and 88 deletions

View File

@ -1557,6 +1557,7 @@ void ReadData::open(char *file)
void ReadData::parse_keyword(int first)
{
int eof = 0;
int done = 0;
// proc 0 reads upto non-blank line plus 1 following line
// eof is set to 1 if any read hits end-of-file
@ -1565,8 +1566,11 @@ void ReadData::parse_keyword(int first)
if (!first) {
if (fgets(line,MAXLINE,fp) == NULL) eof = 1;
}
while (eof == 0 && strspn(line," \t\n\r") == strlen(line)) {
if (fgets(line,MAXLINE,fp) == NULL) eof = 1;
while (eof == 0 && done == 0) {
int blank = strspn(line," \t\n\r");
if ((blank == strlen(line)) || (line[blank] == '#')) {
if (fgets(line,MAXLINE,fp) == NULL) eof = 1;
} else done = 1;
}
if (fgets(buffer,MAXLINE,fp) == NULL) eof = 1;
}