Test: Allow root CInema config
Vicki Pfau vi@endrift.com
Sun, 28 Jun 2020 15:50:42 -0700
1 files changed,
10 insertions(+),
4 deletions(-)
jump to
M
src/platform/test/cinema-main.c
→
src/platform/test/cinema-main.c
@@ -281,10 +281,13 @@ strncat(path, "config.ini", sizeof(path) - 1);
mCoreConfigLoadPath(config, path); HashTableInsert(configTree, key, config); char* pos = strrchr(key, '.'); - if (!pos) { + if (pos) { + pos[0] = '\0'; + } else if (key[0]) { + key[0] = '\0'; + } else { break; } - pos[0] = '\0'; } }@@ -311,10 +314,13 @@ if (str) {
return str; } char* pos = strrchr(testKey, '.'); - if (!pos) { + if (pos) { + pos[0] = '\0'; + } else if (testKey[0]) { + testKey[0] = '\0'; + } else { break; } - pos[0] = '\0'; } return NULL; }