summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChao Song <chao.song@linux.intel.com>2023-03-13 13:38:37 +0800
committerJaroslav Kysela <perex@perex.cz>2023-05-03 16:25:15 +0200
commit52f6fb7f3386d4ecc1481d88bd0bd2b7e47c1332 (patch)
tree6eb33ea09e92addb5a276547d5720fcf2baa1732
parentca503e3519b36cd6497e45d3b2fb633c6102e73b (diff)
downloadalsa-utils-52f6fb7f3386d4ecc1481d88bd0bd2b7e47c1332.tar.gz
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>
-rw-r--r--topology/pre-processor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/topology/pre-processor.c b/topology/pre-processor.c
index 38bb87b..3f20252 100644
--- a/topology/pre-processor.c
+++ b/topology/pre-processor.c
@@ -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(&regex, id, 0);
+ ret = regcomp(&regex, id, REG_EXTENDED | REG_ICASE);
if (ret) {
fprintf(stderr, "Could not compile regex\n");
goto err;
}
/* Execute regular expression */
- ret = regexec(&regex, value, 0, NULL, REG_ICASE);
+ ret = regexec(&regex, value, 0, NULL, 0);
if (ret)
continue;