diff options
author | Chris Robinson <[email protected]> | 2014-02-26 17:25:05 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-02-26 17:25:05 -0800 |
commit | 1b9a722601e59baa1f78cc42f39df40bc6fb9cf6 (patch) | |
tree | 3e5338616cf3289d2bd7c2d1e2dc6779d5742eb6 /Alc/hrtf.c | |
parent | 89506435fa02ceea57db6e7709e8412d4b749311 (diff) |
Expand environment variables for all config option values when loading
Diffstat (limited to 'Alc/hrtf.c')
-rw-r--r-- | Alc/hrtf.c | 31 |
1 files changed, 1 insertions, 30 deletions
@@ -798,42 +798,13 @@ static struct Hrtf *LoadHrtf(ALuint deviceRate) next = fnamelist; while(*(fnamelist=next) != '\0' && *fnamelist != ',') { - next = strpbrk(fnamelist, "%,$"); + next = strpbrk(fnamelist, "%,"); while(fnamelist != next && *fnamelist && i < sizeof(fname)) fname[i++] = *(fnamelist++); if(!next || *next == ',') break; - if(*next == '$') - { - next++; - if(*next == '$') - { - /* '$$' becomes a single '$'. */ - if(i < sizeof(fname)) - fname[i++] = '$'; - next++; - } - else - { - const char *str; - char envname[1024]; - size_t k = 0; - - while((isalnum(*next) || *next == '_') && k < sizeof(envname)-1) - envname[k++] = *(next++); - envname[k++] = '\0'; - - if((str=getenv(envname)) != NULL) - { - int wrote = snprintf(&fname[i], sizeof(fname)-i, "%s", str); - i += minu(wrote, sizeof(fname)-i); - } - } - continue; - } - /* *next == '%' */ next++; if(*next == 'r') |