all repos — mgba @ 72c904cdedaa79eea800fe05a5cf5ad8e1c7ce96

mGBA Game Boy Advance Emulator

Test: Allow root CInema config
Vicki Pfau vi@endrift.com
Sun, 28 Jun 2020 15:50:42 -0700
commit

72c904cdedaa79eea800fe05a5cf5ad8e1c7ce96

parent

f9b572e50b5a2ec826a68b985980f55d6ffb3d54

1 files changed, 10 insertions(+), 4 deletions(-)

jump to
M src/platform/test/cinema-main.csrc/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; }