From: Jaroslav Kysela Date: Tue, 22 Nov 2022 08:59:04 +0000 (+0100) Subject: ucm: handle empty string also for ${env:} substitution X-Git-Tag: v1.2.9~35 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=9649b64c6f72984c53f469dad8dd4221d307e06d;p=alsa-lib.git ucm: handle empty string also for ${env:} substitution Signed-off-by: Jaroslav Kysela --- diff --git a/src/ucm/ucm_subs.c b/src/ucm/ucm_subs.c index 2261bdc2..e62290ea 100644 --- a/src/ucm/ucm_subs.c +++ b/src/ucm/ucm_subs.c @@ -490,7 +490,13 @@ static char *rval_env(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED, const char *i { char *e; - e = getenv(id); + if (*id == '-') { + e = getenv(id + 1); + if (e == NULL) + e = ""; + } else { + e = getenv(id); + } if (e) return strdup(e); return NULL;