campaignd: Allow more than 3 arguments to setattr
This makes it possible to pass strings with whitespace in them. Obviously this is still a bit awkward since only single whitespace is accepted.
This commit is contained in:
parent
e321d18687
commit
297ee3d1ce
1 changed files with 8 additions and 2 deletions
|
@ -612,12 +612,18 @@ void server::handle_read_from_fifo(const boost::system::error_code& error, std::
|
|||
}
|
||||
}
|
||||
} else if(ctl == "setattr") {
|
||||
if(ctl.args_count() != 3) {
|
||||
if(ctl.args_count() < 3) {
|
||||
ERR_CS << "Incorrect number of arguments for 'setattr'\n";
|
||||
} else {
|
||||
const std::string& addon_id = ctl[1];
|
||||
const std::string& key = ctl[2];
|
||||
const std::string& value = ctl[3];
|
||||
std::string value;
|
||||
for (std::size_t i = 3; i <= ctl.args_count(); ++i) {
|
||||
if(i > 3) {
|
||||
value += ' ';
|
||||
}
|
||||
value += ctl[i];
|
||||
}
|
||||
|
||||
config& addon = get_addon(addon_id);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue