From 0b4256e67a5cd080fd48f9428fce409a95df38bb Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Tue, 26 Jan 2021 22:55:19 -0500 Subject: [PATCH] valid numeric type strings can include * --- src/input.cpp | 7 +++++-- src/label_map.cpp | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 1974c2b4f5..8129ed47f8 100755 --- a/src/input.cpp +++ b/src/input.cpp @@ -662,12 +662,15 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) /* ---------------------------------------------------------------------- substitute type labels with numeric value reallocate str to hold expanded version if necessary - if type already starts with a number, do not modify + if type is a valid numerical string (can include *), do not modify ------------------------------------------------------------------------- */ void Input::readtype(char *&str, int mode) { - if (isdigit(str[0])) return; + int numflag = 1; + for (int i = 0; i < strlen(str); i++) + if (!isdigit(str[i]) && str[i] != '*') numflag = 0; + if (numflag) return; if (!atom->labelmapflag) error->all(FLERR,fmt::format("Invalid type {}",str)); int type,max,max2; diff --git a/src/label_map.cpp b/src/label_map.cpp index b23af8f97f..8cd15ed64b 100755 --- a/src/label_map.cpp +++ b/src/label_map.cpp @@ -219,6 +219,8 @@ int LabelMap::find(std::string mylabel, int mode) if (mode == IMPROPER) return search(mylabel,itypelabel,nimpropertypes); + + return -1; } /* ----------------------------------------------------------------------