diff options
author | Jaroslav Kysela <perex@perex.cz> | 2022-11-22 09:59:04 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2022-11-22 09:59:04 +0100 |
commit | 9649b64c6f72984c53f469dad8dd4221d307e06d (patch) | |
tree | 8d994ab8bba3b0d06dfbc7fa8a0505a622cf292e | |
parent | 8b64f22459b6c55ec54f985f35ff701e18800616 (diff) | |
download | alsa-lib-9649b64c6f72984c53f469dad8dd4221d307e06d.tar.gz |
ucm: handle empty string also for ${env:} substitution
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r-- | src/ucm/ucm_subs.c | 8 |
1 files changed, 7 insertions, 1 deletions
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; |