From c509e6c1ddaa78b63010b430b257ffe0318c46b1 Mon Sep 17 00:00:00 2001 From: Chao Song Date: Mon, 13 Mar 2023 13:38:37 +0800 Subject: [PATCH] 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. Signed-off-by: Chao Song --- topology/pre-processor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/topology/pre-processor.c b/topology/pre-processor.c index 38bb87b51..3f2025235 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(®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;