Unverified Commit 83d58ba5 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

we may not use "suffix on" before a suffix is defined. switching back to a...

we may not use "suffix on" before a suffix is defined. switching back to a non-hybrid suffix must set suffix2 to NULL
parent 1df59c4b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1904,8 +1904,11 @@ void Input::suffix()
  if (narg < 1) error->all(FLERR,"Illegal suffix command");

  if (strcmp(arg[0],"off") == 0) lmp->suffix_enable = 0;
  else if (strcmp(arg[0],"on") == 0) lmp->suffix_enable = 1;
  else {
  else if (strcmp(arg[0],"on") == 0) {
    if (!lmp->suffix)
      error->all(FLERR,"May only enable suffixes after defining one");
    lmp->suffix_enable = 1;
  } else {
    lmp->suffix_enable = 1;

    delete [] lmp->suffix;
@@ -1924,6 +1927,7 @@ void Input::suffix()
      int n = strlen(arg[0]) + 1;
      lmp->suffix = new char[n];
      strcpy(lmp->suffix,arg[0]);
      lmp->suffix2 = nullptr;
    }
  }
}