Skip to content
Snippets Groups Projects
Commit cf24e7d2 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Fix a configurable update bug

parent 948c5ebd
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
......@@ -385,20 +385,20 @@ bool ftl::config::update(const std::string &puri, const json_t &value) {
string tail = "";
string head = "";
string uri = preprocessURI(puri);
size_t last_hash = uri.find_last_of('#');
if (last_hash != string::npos) {
//size_t last_hash = uri.find_last_of('/');
//if (last_hash != string::npos) {
size_t last = uri.find_last_of('/');
if (last != string::npos && last > last_hash) {
//if (last != string::npos && last > last_hash) {
tail = uri.substr(last+1);
head = uri.substr(0, last);
} else {
tail = uri.substr(last_hash+1);
head = uri.substr(0, last_hash);
}
} else {
LOG(WARNING) << "Expected a # in an update URI: " << uri;
return false;
}
//} else {
// tail = uri.substr(last_hash+1);
// head = uri.substr(0, last_hash);
//}
//} else {
// LOG(WARNING) << "Expected a # in an update URI: " << uri;
// return false;
//}
Configurable *cfg = find(head);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment