mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-01 22:58:49 -04:00
ucm: String condition - implement Empty
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
f688817e2c
commit
a53a104f79
1 changed files with 17 additions and 0 deletions
|
|
@ -44,6 +44,23 @@ static int if_eval_string(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval)
|
|||
char *s1, *s2;
|
||||
int err;
|
||||
|
||||
if (uc_mgr->conf_format >= 3) {
|
||||
err = get_string(eval, "Empty", &string1);
|
||||
if (err < 0 && err != -ENOENT) {
|
||||
uc_error("String error (If.Condition.Empty)");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (string1) {
|
||||
err = uc_mgr_get_substituted_value(uc_mgr, &s1, string1);
|
||||
if (err < 0)
|
||||
return err;
|
||||
err = s1 == NULL || s1[0] == '\0';
|
||||
free(s1);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
err = get_string(eval, "String1", &string1);
|
||||
if (err < 0 && err != -ENOENT) {
|
||||
uc_error("String error (If.Condition.String1)");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue