From 0014941fad222fb8c0c791ad11950506f42754d6 Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Mon, 9 Jul 2018 11:18:47 +0200 Subject: [PATCH] allow a forward slash in topic names for ROS2 compatibility Signed-off-by: Erik Boasson --- src/core/ddsc/src/dds_topic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/ddsc/src/dds_topic.c b/src/core/ddsc/src/dds_topic.c index 8f3aabe..683838b 100644 --- a/src/core/ddsc/src/dds_topic.c +++ b/src/core/ddsc/src/dds_topic.c @@ -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') {