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>
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;