Skip to content

Commit 52ded65

Browse files
committed
EAMxx: add an additional check for multiple ":="
1 parent 1a348d8 commit 52ded65

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/eamxx/src/share/io/eamxx_io_utils.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ parse_field_alias (const std::string& field_spec)
252252
EKAT_REQUIRE_MSG(!alias.empty() && !field_name.empty(),
253253
"Error! Invalid field alias specification: '" + field_spec + "'\n"
254254
"Expected format: 'alias:=field_name' where both alias and field_name are non-empty.\n");
255-
255+
256+
auto another_pos = field_name.find(delimiter);
257+
EKAT_REQUIRE_MSG(another_pos == std::string::npos,
258+
"Error! Invalid field alias specification: '" + field_spec + "'\n"
259+
"Multiple ':=' tokens found.\n");
256260
return {alias, field_name};
257261
}
258262

0 commit comments

Comments
 (0)