allow a forward slash in topic names for ROS2 compatibility

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2018-07-09 11:18:47 +02:00
parent 890af34168
commit 0014941fad

View file

@ -62,10 +62,11 @@ is_valid_name(
* | '0', ..., '9',
* | '-' but may not start with a digit.
* It is considered that '-' is an error in the spec and should say '_'. So, that's what we'll check for.
* | '/' got added for ROS2
*/
assert(name);
if ((name[0] != '\0') && (!isdigit((unsigned char)name[0]))) {
while (isalnum((unsigned char)*name) || (*name == '_')) {
while (isalnum((unsigned char)*name) || (*name == '_') || (*name == '/')) {
name++;
}
if (*name == '\0') {