diff options
author | Chris Robinson <[email protected]> | 2009-11-22 01:06:05 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-11-22 01:06:05 -0800 |
commit | 1b18b4a0ee6ba20325e68ccc7e07f4db08413d23 (patch) | |
tree | 123aab499748f882e3a20c04eeb9411c3a7c2be6 /Alc | |
parent | 58765aab6b126ac4bfdad0ae0bfb1b845fbf65b0 (diff) |
Allow unlisted backends to stay available when the drivers list ends with ,
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -259,6 +259,7 @@ static void alc_init(void) int n; size_t len; const char *next = devs; + int endlist; i = 0; do { @@ -266,7 +267,11 @@ static void alc_init(void) next = strchr(devs, ','); if(!devs[0] || devs[0] == ',') + { + endlist = 0; continue; + } + endlist = 1; len = (next ? ((size_t)(next-devs)) : strlen(devs)); for(n = i;BackendList[n].Init;n++) @@ -274,19 +279,27 @@ static void alc_init(void) if(len == strlen(BackendList[n].name) && strncmp(BackendList[n].name, devs, len) == 0) { - BackendInfo Bkp = BackendList[i]; - BackendList[i] = BackendList[n]; + BackendInfo Bkp = BackendList[n]; + while(n > i) + { + BackendList[n] = BackendList[n-1]; + --n; + } BackendList[n] = Bkp; i++; + break; } } } while(next++); - BackendList[i].name = NULL; - BackendList[i].Init = NULL; - BackendList[i].Deinit = NULL; - BackendList[i].Probe = NULL; + if(endlist) + { + BackendList[i].name = NULL; + BackendList[i].Init = NULL; + BackendList[i].Deinit = NULL; + BackendList[i].Probe = NULL; + } } for(i = 0;BackendList[i].Init;i++) |