diff --git a/fairmq/SuboptParser.cxx b/fairmq/SuboptParser.cxx index 3745a327..959b8541 100644 --- a/fairmq/SuboptParser.cxx +++ b/fairmq/SuboptParser.cxx @@ -17,8 +17,9 @@ #include #include - -#include // make_pair +#include +#include // make_pair +#include using boost::property_tree::ptree; using namespace std; @@ -83,6 +84,14 @@ Properties SuboptParser(const vector& channelConfig, const string& devic string argString(token); char* subopts = &argString[0]; char* value = nullptr; + // Find either a : or a =. If we find the former first, we consider what is before it + // the channel name + char* firstSep = strpbrk(subopts, ":="); + if (firstSep && *firstSep == ':') { + channelName = std::string_view(subopts, firstSep - subopts); + channelProperties.put("name", channelName); + subopts = firstSep + 1; + } while (subopts && *subopts != 0 && *subopts != ' ') { char* cur = subopts; int subopt = getsubopt(&subopts, (char**)channelOptionKeys, &value);