summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2022-02-22 09:50:30 +0100
committerJaroslav Kysela <perex@perex.cz>2022-02-22 09:51:29 +0100
commitc41d710a69941d052e345fcc883e102c37d6deae (patch)
tree76fcb0ca6dca0506c7bc4b0409be7de09ebe84a6
parent3dbe072d8deba7c11f6e766ef80c0e50a69447d0 (diff)
downloadalsa-lib-c41d710a69941d052e345fcc883e102c37d6deae.tar.gz
ucm: fix the '${eval:EXPR}' substitution
There was already a variable substitution. Skip it for the eval: case. Fixes: 7b6da9ee ("ucm: add ${eval:EXPR} substitution (Syntax 5)") Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r--src/ucm/ucm_subs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ucm/ucm_subs.c b/src/ucm/ucm_subs.c
index 0ed400d1..530bccbd 100644
--- a/src/ucm/ucm_subs.c
+++ b/src/ucm/ucm_subs.c
@@ -727,6 +727,8 @@ __match2:
strncpy_with_escape(v2, value + idsize, rvalsize);
idsize += rvalsize + 1;
if (*v2 == '$' && uc_mgr->conf_format >= 3) {
+ if (strncmp(value, "${eval:", 7) == 0)
+ goto __direct_fcn2;
tmp = uc_mgr_get_variable(uc_mgr, v2 + 1);
if (tmp == NULL) {
uc_error("define '%s' is not reachable in this context!", v2 + 1);
@@ -735,6 +737,7 @@ __match2:
rval = fcn2(uc_mgr, tmp);
}
} else {
+__direct_fcn2:
rval = fcn2(uc_mgr, v2);
}
goto __rval;