mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Simplified and fixed semantic
This commit is contained in:
parent
58808e42b6
commit
cf325c68e3
1 changed files with 11 additions and 15 deletions
26
src/conf.c
26
src/conf.c
|
|
@ -1451,25 +1451,21 @@ int snd_config_search_alias(snd_config_t *config,
|
|||
const char *base, const char *key,
|
||||
snd_config_t **result)
|
||||
{
|
||||
snd_config_t *res;
|
||||
snd_config_t *res = NULL;
|
||||
int err;
|
||||
assert(config && key);
|
||||
if (base) {
|
||||
err = snd_config_searchv(config, &res, base, key, NULL);
|
||||
} else {
|
||||
do {
|
||||
err = snd_config_search(config, key, &res);
|
||||
}
|
||||
if (err < 0)
|
||||
return err;
|
||||
while (snd_config_get_string(res, &base) >= 0) {
|
||||
err = snd_config_search(config, base, &res);
|
||||
if (err >= 0) {
|
||||
if (snd_config_get_string(res, &key) >= 0)
|
||||
err = snd_config_search(res, key, &res);
|
||||
if (err < 0) {
|
||||
if (!base)
|
||||
break;
|
||||
err = snd_config_searchv(config, &res, base, key, NULL);
|
||||
if (err < 0)
|
||||
break;
|
||||
}
|
||||
if (err < 0)
|
||||
break;
|
||||
}
|
||||
} while (snd_config_get_string(res, &key) >= 0);
|
||||
if (!res)
|
||||
return err;
|
||||
if (result)
|
||||
*result = res;
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue