ros / dynamic_reconfigure

BSD 3-Clause "New" or "Revised" License
47 stars 112 forks source link

Parameter description containing quotes are not properly escaped in generated C++ file #142

Open VorpalBlade opened 5 years ago

VorpalBlade commented 5 years ago

Using ROS Kinetic, if a parameter contains quotes in the description:

gen.add("param", int_t, 0, 'Fancy "quotes" in here' , 0, 0, 10)

Then this results in invalid C++ code in the statics section:

//#line 290 "/opt/ros/kinetic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
      Default.abstract_parameters.push_back(QuickMCLConfig::AbstractParamDescriptionConstPtr(new QuickMCLConfig::ParamDescription<int>("param", "int", 0, "Fancy "quotes" in here", "", &QuickMCLConfig::param)));
//#line 290 "/opt/ros/kinetic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
      __param_descriptions__.push_back(QuickMCLConfig::AbstractParamDescriptionConstPtr(new QuickMCLConfig::ParamDescription<int>("param", "int", 0, "Fancy "quotes" in here", "", &QuickMCLConfig::param)));

Note that the quotes are not properly escaped in the C++ code.