diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-01-20 01:07:28 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2009-01-20 01:07:28 +0100 |
commit | 00d91c8ca4a5d35d5c3706d0042f0e57cefa3d12 (patch) | |
tree | 181d6d874f2cdd3f8f2123b94a3617ecae60a1ad /list.c | |
parent | 9d0c6014304f1dd2f1f7a57e2039520b0f330250 (diff) | |
download | uci-00d91c8ca4a5d35d5c3706d0042f0e57cefa3d12.tar.gz |
make the uci_ptr struct reusable after a call to uci_delete()
Diffstat (limited to 'list.c')
-rw-r--r-- | list.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -567,6 +567,12 @@ int uci_delete(struct uci_context *ctx, struct uci_ptr *ptr) uci_add_history(ctx, &p->history, UCI_CMD_REMOVE, ptr->section, ptr->option, NULL); uci_free_any(&e); + + if (ptr->option) + ptr->o = NULL; + else if (ptr->section) + ptr->s = NULL; + return 0; } |