fix last commit not properly reloading changed options from disc, whoops

This commit is contained in:
UnknownShadow200 2020-07-01 21:23:28 +10:00
parent 278e7c70cd
commit 669dac1738
3 changed files with 4 additions and 3 deletions

View File

@ -134,12 +134,14 @@ static cc_bool Options_LoadFilter(const String* entry) {
}
void Options_Load(void) {
static cc_bool loaded;
String entry, key, value;
int i;
if (!Options.path) {
if (!loaded) {
EntryList_Init(&Options, "options-default.txt", '=');
EntryList_Init(&Options, "options.txt", '=');
loaded = true;
} else {
/* Reset all the unchanged options */
for (i = Options.entries.count - 1; i >= 0; i--) {

View File

@ -256,7 +256,7 @@ void EntryList_Load(struct EntryList* list, const char* file, EntryList_Filter f
/* If don't prevent this here, client aborts in StringsBuffer_Add */
if (entry.length > STRINGSBUFFER_LEN_MASK) {
entry.length = 0;
String_Format1(&entry, "Skipping extremely long line in %c, file may have been corrupted", list->path);
String_Format1(&entry, "Skipping extremely long line in %c, file may have been corrupted", file);
Logger_WarnFunc(&entry); continue;
}

View File

@ -55,7 +55,6 @@ int Convert_ToBase64(const cc_uint8* src, int len, char* dst);
int Convert_FromBase64(const char* src, int len, cc_uint8* dst);
struct EntryList {
const char* path;
char separator;
struct StringsBuffer entries;
};