13
0

don't force rename of reserved route/IO names if the name isn't taken yet

This commit is contained in:
Paul Davis 2015-11-07 22:15:59 -05:00
parent 09672f4a50
commit 3d5bdbbe66

View File

@ -2214,9 +2214,14 @@ Session::find_route_name (string const & base, uint32_t& id, string& name, bool
for (vector<string>::const_iterator reserved = reserved_io_names.begin(); reserved != reserved_io_names.end(); ++reserved) { for (vector<string>::const_iterator reserved = reserved_io_names.begin(); reserved != reserved_io_names.end(); ++reserved) {
if (base == *reserved) { if (base == *reserved) {
definitely_add_number = true; /* Check if this reserved name already exists, and if
if (id < 1) { so, disallow it without a numeric suffix.
id = 1; */
if (route_by_name (*reserved)) {
definitely_add_number = true;
if (id < 1) {
id = 1;
}
} }
break; break;
} }
@ -3753,7 +3758,11 @@ Session::io_name_is_legal (const std::string& name)
for (vector<string>::const_iterator reserved = reserved_io_names.begin(); reserved != reserved_io_names.end(); ++reserved) { for (vector<string>::const_iterator reserved = reserved_io_names.begin(); reserved != reserved_io_names.end(); ++reserved) {
if (name == *reserved) { if (name == *reserved) {
return false; if (route_by_name (*reserved)) {
return false;
} else {
return true;
}
} }
} }