Unverified Commit 07c5adc5 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

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

parent 381ac888
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include "atom.h"
#include "memory.h"
#include "error.h"
#include "utils.h"

using namespace LAMMPS_NS;

@@ -58,13 +59,13 @@ int ReaderNative::read_time(bigint &ntimestep)

  // 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);

  if (strstr(line,"ITEM: TIME") == line)
  if (utils::strmatch(line,"^\\s*ITEM: TIME\\s*$"))
    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");

  read_lines(1);