From: Toni Wilen Date: Sun, 26 Mar 2023 18:45:58 +0000 (+0300) Subject: Fix ini whole section delete. X-Git-Tag: 5.0.0~98 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=aab96d084e412be13592f4bbbf51747b54480b41;p=francis%2Fwinuae.git Fix ini whole section delete. --- diff --git a/ini.cpp b/ini.cpp index 6528b533..0cc8de50 100644 --- a/ini.cpp +++ b/ini.cpp @@ -565,6 +565,7 @@ bool ini_addstring(struct ini_data *ini, const TCHAR *section, const TCHAR *key, bool ini_delete(struct ini_data *ini, const TCHAR *section, const TCHAR *key) { + bool deleted = false; for (int c = 0; c < ini->inilines; c++) { struct ini_line *il = ini->inidata[c]; if (il && !_tcsicmp(section, il->section) && (key == NULL || !_tcsicmp(key, il->key))) { @@ -574,9 +575,8 @@ bool ini_delete(struct ini_data *ini, const TCHAR *section, const TCHAR *key) xfree(il); ini->inidata[c] = NULL; ini->modified = true; - return true; + deleted = true; } } - return false; + return deleted; } -