module: fix argument parsing

Skip spaces before the key. When the previous key ends with a ' or when
there are 2 spaces between keys, the key includes the whitespace
otherwise.

See #2086
This commit is contained in:
Wim Taymans 2022-02-06 18:34:35 +01:00
parent 60b110ff93
commit 9ec782630c

View file

@ -25,6 +25,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include <spa/utils/defs.h> #include <spa/utils/defs.h>
#include <spa/utils/list.h> #include <spa/utils/list.h>
@ -143,6 +144,8 @@ void module_args_add_props(struct pw_properties *props, const char *str)
const struct str_map *map; const struct str_map *map;
while (*p) { while (*p) {
while (*p && isspace(*p))
p++;
e = strchr(p, '='); e = strchr(p, '=');
if (e == NULL) if (e == NULL)
break; break;