allow a forward slash in topic names for ROS2 compatibility
Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
890af34168
commit
0014941fad
1 changed files with 2 additions and 1 deletions
|
@ -62,10 +62,11 @@ is_valid_name(
|
||||||
* | '0', ..., '9',
|
* | '0', ..., '9',
|
||||||
* | '-' but may not start with a digit.
|
* | '-' 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.
|
* 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);
|
assert(name);
|
||||||
if ((name[0] != '\0') && (!isdigit((unsigned char)name[0]))) {
|
if ((name[0] != '\0') && (!isdigit((unsigned char)name[0]))) {
|
||||||
while (isalnum((unsigned char)*name) || (*name == '_')) {
|
while (isalnum((unsigned char)*name) || (*name == '_') || (*name == '/')) {
|
||||||
name++;
|
name++;
|
||||||
}
|
}
|
||||||
if (*name == '\0') {
|
if (*name == '\0') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue