we need more specific matches to correctly handle TIME and TIMESTEP items

This commit is contained in:
Axel Kohlmeyer 2020-02-14 16:07:34 -05:00
parent 381ac888c8
commit 07c5adc57a
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 4 additions and 3 deletions

View File

@ -17,6 +17,7 @@
#include "atom.h" #include "atom.h"
#include "memory.h" #include "memory.h"
#include "error.h" #include "error.h"
#include "utils.h"
using namespace LAMMPS_NS; using namespace LAMMPS_NS;
@ -58,13 +59,13 @@ int ReaderNative::read_time(bigint &ntimestep)
// skip over unit and time information, if present. // skip over unit and time information, if present.
if (strstr(line,"ITEM: UNITS") == line) if (utils::strmatch(line,"^\\s*ITEM: UNITS\\s*$"))
read_lines(2); read_lines(2);
if (strstr(line,"ITEM: TIME") == line) if (utils::strmatch(line,"^\\s*ITEM: TIME\\s*$"))
read_lines(2); read_lines(2);
if (strstr(line,"ITEM: TIMESTEP") != line) if (!utils::strmatch(line,"^\\s*ITEM: TIMESTEP\\s*$"))
error->one(FLERR,"Dump file is incorrectly formatted"); error->one(FLERR,"Dump file is incorrectly formatted");
read_lines(1); read_lines(1);