]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Don't accept an empty string for $ALSA_CONFIG_PATH
authorTakashi Iwai <tiwai@suse.de>
Wed, 10 Dec 2008 17:20:50 +0000 (18:20 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 10 Dec 2008 17:20:50 +0000 (18:20 +0100)
The variable $ALSA_CONFIG_PATH specifies the config path, but the current
code accepts the empty string and results in a mysterious error because
no config file is found.

This patch fixes the check of the variable and takes the default value
if the string is empty.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/conf.c

index 32a76085034600f937bd16412b25f818af5962a0..c86f819b1e024280d7079a645630eb2482e42c30 100644 (file)
@@ -2962,7 +2962,7 @@ int snd_config_update_r(snd_config_t **_top, snd_config_update_t **_update, cons
        configs = cfgs;
        if (!configs) {
                configs = getenv(ALSA_CONFIG_PATH_VAR);
-               if (!configs)
+               if (!configs || !*configs)
                        configs = ALSA_CONFIG_PATH_DEFAULT;
        }
        for (k = 0, c = configs; (l = strcspn(c, ": ")) > 0; ) {