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