command: fix load-module arguments

Reparse the arguments and pass all the remaining strings after the
module name as one arguments string.
This commit is contained in:
Wim Taymans 2020-02-07 13:25:19 +01:00
parent a7e36ddd9d
commit 4d143c5751
2 changed files with 5 additions and 1 deletions

View file

@ -218,6 +218,7 @@ static struct pw_command *parse_command_module_load(struct pw_properties *proper
this = &impl->this; this = &impl->this;
this->func = execute_command_module_load; this->func = execute_command_module_load;
this->args = pw_split_strv(line, whitespace, INT_MAX, &this->n_args); this->args = pw_split_strv(line, whitespace, INT_MAX, &this->n_args);
for (arg = 1; arg < this->n_args; arg++) { for (arg = 1; arg < this->n_args; arg++) {
@ -227,6 +228,9 @@ static struct pw_command *parse_command_module_load(struct pw_properties *proper
if (arg + 1 > this->n_args) if (arg + 1 > this->n_args)
goto no_module; goto no_module;
pw_free_strv(this->args);
this->args = pw_split_strv(line, whitespace, arg + 2, &this->n_args);
impl->first_arg = arg; impl->first_arg = arg;
return this; return this;

View file

@ -189,7 +189,7 @@ pw_context_load_module(struct pw_context *context,
if (filename == NULL) if (filename == NULL)
goto error_not_found; goto error_not_found;
pw_log_debug("trying to load module: %s (%s)", name, filename); pw_log_debug("trying to load module: %s (%s) args(%s)", name, filename, args);
hnd = dlopen(filename, RTLD_NOW | RTLD_LOCAL); hnd = dlopen(filename, RTLD_NOW | RTLD_LOCAL);
if (hnd == NULL) if (hnd == NULL)