mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-08 20:05:42 +01:00
topology: pre-processor: fix regular expression flags
The REG_ICASE flag is a compile-time flag (cflags), it should be used with regcomp() instead of regexec(). Also add the REG_EXTENDED flag in this patch to make patterns like 'tgl|adl' work. Fixes: https://github.com/alsa-project/alsa-utils/pull/195 Signed-off-by: Chao Song <chao.song@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
ca503e3519
commit
52f6fb7f33
1 changed files with 2 additions and 2 deletions
|
@ -493,14 +493,14 @@ static int pre_process_include_conf(struct tplg_pre_processor *tplg_pp, snd_conf
|
|||
if (snd_config_get_id(n, &id) < 0)
|
||||
continue;
|
||||
|
||||
ret = regcomp(®ex, id, 0);
|
||||
ret = regcomp(®ex, id, REG_EXTENDED | REG_ICASE);
|
||||
if (ret) {
|
||||
fprintf(stderr, "Could not compile regex\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Execute regular expression */
|
||||
ret = regexec(®ex, value, 0, NULL, REG_ICASE);
|
||||
ret = regexec(®ex, value, 0, NULL, 0);
|
||||
if (ret)
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Reference in a new issue