Fix ini whole section delete.

This commit is contained in:
Toni Wilen 2023-03-26 21:45:58 +03:00
parent 0c65b8bdbd
commit aab96d084e

View File

@ -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;
}