]> git.alsa-project.org Git - alsa-lib.git/commitdiff
ucm: fix the DefineRegex issue where multiple variables were set to empty string
authorJaroslav Kysela <perex@perex.cz>
Tue, 2 Dec 2025 09:59:19 +0000 (10:59 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 4 Dec 2025 11:11:41 +0000 (12:11 +0100)
It is not required to set variables in undefined groups to empty string.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/ucm/ucm_regex.c

index cef23626b785e8fb8e2dbfd95e3ea63b1822bc03..8c257a0fc2a1cac570d4232ab80f88ec985a31b4 100644 (file)
@@ -73,7 +73,7 @@ static int set_variables(snd_use_case_mgr_t *uc_mgr, const char *data,
        if (err < 0)
                return err;
        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;
                s = extract_substring(data, &match[i]);
                if (s == NULL)