ucm: fix the DefineRegex issue where multiple variables were set to empty string

It is not required to set variables in undefined groups to empty string.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2025-12-02 10:59:19 +01:00
parent ae921dc1c9
commit 5ed27d8e89

View file

@ -73,7 +73,7 @@ static int set_variables(snd_use_case_mgr_t *uc_mgr, const char *data,
if (err < 0) if (err < 0)
return err; return err;
for (i = 1; i < match_size; i++) { for (i = 1; i < match_size; i++) {
if (match[0].rm_so < 0 || match[0].rm_eo < 0) if (match[i].rm_so < 0 || match[i].rm_eo < 0)
return 0; return 0;
s = extract_substring(data, &match[i]); s = extract_substring(data, &match[i]);
if (s == NULL) if (s == NULL)