From 6367c8b601720744acefd78239f6f7a0956e9487 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Tue, 18 Sep 2012 22:29:33 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8794 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/MOLECULE/angle_table.cpp | 3 ++- src/MOLECULE/bond_table.cpp | 3 ++- src/USER-MISC/dihedral_table.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/MOLECULE/angle_table.cpp b/src/MOLECULE/angle_table.cpp index 0be817acc7..88b1f97ac6 100644 --- a/src/MOLECULE/angle_table.cpp +++ b/src/MOLECULE/angle_table.cpp @@ -379,7 +379,8 @@ void AngleTable::read_table(Table *tb, char *file, char *keyword) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment - if (strstr(line,keyword) == line) break; // matching keyword + char *word = strtok(line," \t\n\r"); + if (strcmp(word,keyword) == 0) break; // matching keyword fgets(line,MAXLINE,fp); // no match, skip section param_extract(tb,line); fgets(line,MAXLINE,fp); diff --git a/src/MOLECULE/bond_table.cpp b/src/MOLECULE/bond_table.cpp index 1f83c7980f..dc6a637d8b 100644 --- a/src/MOLECULE/bond_table.cpp +++ b/src/MOLECULE/bond_table.cpp @@ -302,7 +302,8 @@ void BondTable::read_table(Table *tb, char *file, char *keyword) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment - if (strstr(line,keyword) == line) break; // matching keyword + char *word = strtok(line," \t\n\r"); + if (strcmp(word,keyword) == 0) break; // matching keyword fgets(line,MAXLINE,fp); // no match, skip section param_extract(tb,line); fgets(line,MAXLINE,fp); diff --git a/src/USER-MISC/dihedral_table.cpp b/src/USER-MISC/dihedral_table.cpp index 89d4b6e39d..7465779c0d 100644 --- a/src/USER-MISC/dihedral_table.cpp +++ b/src/USER-MISC/dihedral_table.cpp @@ -703,7 +703,8 @@ void DihedralTable::read_table(Table *tb, char *file, char *keyword) } if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment - if (strstr(line,keyword) == line) break; // matching keyword + char *word = strtok(line," \t\n\r"); + if (strcmp(word,keyword) == 0) break; // matching keyword fgets(line,MAXLINE,fp); // no match, skip section param_extract(tb,line); fgets(line,MAXLINE,fp);