From 8e5af55ae5da2e638160522f618b6e87ae1cfb7e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 8 Oct 2021 04:10:37 +0200 Subject: [PATCH] Prevent identical port-names when renaming tracks Audio ports are sorted using PBD::naturally_less. PBD::naturally_less is also used as compare function for port-lists, port-sets, and port-maps. So in sets and maps, the function is used to test for uniqueness. This lead to issues since naturally_less treats whitespace and underscores as identical. While it was possible to have routes named "Audio_1", and "Audio 1", this resulted in missing ports for one of the routes. see also 60ff3ef7645d --- libs/ardour/route.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 6efc03c0aa..52363e9a4e 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -4810,9 +4810,8 @@ Route::has_io_processor_named (const string& name) ProcessorList::iterator i; for (i = _processors.begin(); i != _processors.end(); ++i) { - if (boost::dynamic_pointer_cast (*i) || - boost::dynamic_pointer_cast (*i)) { - if ((*i)->name() == name) { + if (boost::dynamic_pointer_cast (*i)) { + if (0 == PBD::natcmp ((*i)->name().c_str(), name.c_str())) { return true; } }