]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix ini whole section delete.
authorToni Wilen <twilen@winuae.net>
Sun, 26 Mar 2023 18:45:58 +0000 (21:45 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 26 Mar 2023 18:45:58 +0000 (21:45 +0300)
ini.cpp

diff --git a/ini.cpp b/ini.cpp
index 6528b53387dc0b1cf7a092f86f27037b81d29381..0cc8de50ad14dc885626f8dff3bfd55f6eaa75b1 100644 (file)
--- 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;
 }
-