aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/alcConfig.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/Alc/alcConfig.c b/Alc/alcConfig.c
index 4c523886..847e5d13 100644
--- a/Alc/alcConfig.c
+++ b/Alc/alcConfig.c
@@ -277,24 +277,24 @@ const char *GetConfigValue(const char *blockName, const char *keyName, const cha
{
size_t i, j;
- if(keyName)
+ if(!keyName)
+ return def;
+
+ if(!blockName)
+ blockName = "general";
+
+ for(i = 0;i < cfgCount;i++)
{
- if(!blockName)
- blockName = "general";
+ if(strcasecmp(cfgBlocks[i].name, blockName) != 0)
+ continue;
- for(i = 0;i < cfgCount;i++)
+ for(j = 0;j < cfgBlocks[i].entryCount;j++)
{
- if(strcasecmp(cfgBlocks[i].name, blockName) != 0)
- continue;
-
- for(j = 0;j < cfgBlocks[i].entryCount;j++)
+ if(strcasecmp(cfgBlocks[i].entries[j].key, keyName) == 0)
{
- if(strcasecmp(cfgBlocks[i].entries[j].key, keyName) == 0)
- {
- if(cfgBlocks[i].entries[j].value[0])
- return cfgBlocks[i].entries[j].value;
- return def;
- }
+ if(cfgBlocks[i].entries[j].value[0])
+ return cfgBlocks[i].entries[j].value;
+ return def;
}
}
}