ucm: handle empty string also for ${env:} substitution

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2022-11-22 09:59:04 +01:00
parent 8b64f22459
commit 9649b64c6f

View file

@ -490,7 +490,13 @@ static char *rval_env(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED, const char *i
{ {
char *e; char *e;
e = getenv(id); if (*id == '-') {
e = getenv(id + 1);
if (e == NULL)
e = "";
} else {
e = getenv(id);
}
if (e) if (e)
return strdup(e); return strdup(e);
return NULL; return NULL;