From 669dac1738f51a00d3ee583fce11f6691d6afdee Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 1 Jul 2020 21:23:28 +1000 Subject: [PATCH] fix last commit not properly reloading changed options from disc, whoops --- src/Options.c | 4 +++- src/Utils.c | 2 +- src/Utils.h | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Options.c b/src/Options.c index eb9929636..a6c968471 100644 --- a/src/Options.c +++ b/src/Options.c @@ -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--) { diff --git a/src/Utils.c b/src/Utils.c index 4efbe2ea5..2dc9a40e6 100644 --- a/src/Utils.c +++ b/src/Utils.c @@ -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; } diff --git a/src/Utils.h b/src/Utils.h index 457161a6b..92a08f100 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -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; };