mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 10:31:16 +00:00
- Set defaults if ini exists, but empty.
- Create a new dictionary object, not use null object.
This commit is contained in:
parent
d6aaa6b9da
commit
f2226e65cb
@ -1074,7 +1074,7 @@ bool IsleApp::LoadConfig()
|
|||||||
|
|
||||||
// [library:config]
|
// [library:config]
|
||||||
// Load sane defaults if dictionary failed to load
|
// Load sane defaults if dictionary failed to load
|
||||||
if (!dict) {
|
if (!dict || dict->n == 0) {
|
||||||
if (m_iniPath) {
|
if (m_iniPath) {
|
||||||
SDL_Log("Invalid config path '%s'", m_iniPath);
|
SDL_Log("Invalid config path '%s'", m_iniPath);
|
||||||
return false;
|
return false;
|
||||||
@ -1094,7 +1094,7 @@ bool IsleApp::LoadConfig()
|
|||||||
}
|
}
|
||||||
|
|
||||||
char buf[32];
|
char buf[32];
|
||||||
dict = iniparser_load(iniConfig.GetData());
|
dict = dictionary_new(0);
|
||||||
iniparser_set(dict, "isle", NULL);
|
iniparser_set(dict, "isle", NULL);
|
||||||
|
|
||||||
iniparser_set(dict, "isle:diskpath", SDL_GetBasePath());
|
iniparser_set(dict, "isle:diskpath", SDL_GetBasePath());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user