Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions siteupdate/cplusplus/classes/Waypoint/Waypoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,10 @@ void Waypoint::underscore_datachecks(const char *slash)
if (strchr(underscore+1, '_'))
Datacheck::add(route, label, "", "", "LABEL_UNDERSCORES", "");
// look for too many characters after underscore in label
if (label.data()+label.size() > underscore+4)
if (label.back() > 'Z' || label.back() < 'A' || label.data()+label.size() > underscore+5)
Datacheck::add(route, label, "", "", "LONG_UNDERSCORE", "");
if ( label.data()+label.size() > underscore+4
&& (label.back() > 'Z' || label.back() < 'A' || label.data()+label.size() > underscore+5) // allow "CitA" city+letter
&& (underscore[1] != 'U' || !isdigit(underscore[2])) // allow "_U100" U-turns
) Datacheck::add(route, label, "", "", "LONG_UNDERSCORE", "");
// look for labels with a slash after an underscore
if (slash > underscore)
Datacheck::add(route, label, "", "", "NONTERMINAL_UNDERSCORE", "");
Expand Down