1
0
Fork 0
forked from fun/fun

Tons of INI parser fixes to realy make it work. (0.37.40)

This commit is contained in:
Johannes Findeisen 2026-01-02 23:20:09 +01:00
commit d9372ce874
15 changed files with 264 additions and 66 deletions

View file

@ -20,9 +20,13 @@ case OP_INI_UNSET: {
const char *sec = (vsec.type==VAL_STRING)?vsec.s:NULL;
int ok = 0;
if (d && sec && key) {
char full[1024]; snprintf(full, sizeof(full), "%s:%s", sec, key);
/* iniparser 4.2.6 dictionary_unset returns void; assume success if inputs are valid */
char full[1024]; char alt[1024];
ini_make_full_key(full, sizeof(full), sec, key);
memcpy(alt, full, sizeof(alt));
for (size_t i = 0; i < sizeof(alt) && alt[i]; ++i) { if (alt[i] == ':') { alt[i] = '.'; break; } }
/* iniparser 4.2.6 dictionary_unset returns void; remove both forms */
dictionary_unset(d, full);
dictionary_unset(d, alt);
ok = 1;
}
free_value(vkey); free_value(vsec); free_value(vh);