diff --git a/src/rime/config/config_data.cc b/src/rime/config/config_data.cc index 0151f94b4e..bb51adaa77 100644 --- a/src/rime/config/config_data.cc +++ b/src/rime/config/config_data.cc @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -208,12 +209,20 @@ vector ConfigData::SplitPath(const string& path) { vector keys; auto is_separator = boost::is_any_of("/"); auto trimmed_path = boost::trim_left_copy_if(path, is_separator); - boost::split(keys, trimmed_path, is_separator); + boost::regex re("(?& keys) { - return boost::join(keys, "/"); + std::vector _keys(keys); + for(auto i = 0; i < _keys.size(); i++) { + _keys.at(i) = boost::regex_replace(_keys.at(i), boost::regex("^/"), "\\\\/"); + } + return boost::join(_keys, "/"); } an ConfigData::Traverse(const string& path) {