diff options
author | Krzysztof Kuźnik <k.kuznik@avsystem.com> | 2013-02-28 13:44:00 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2013-05-02 14:30:31 +0200 |
commit | b42ee8f21842fab41a4cdf27960000bb1b3f42a7 (patch) | |
tree | 68d42fdf1209a62fe9fd479fb88341c4f1dfbb59 | |
parent | 07d6fd66f6a20e35490bc8b55d26fdb389016120 (diff) | |
download | uci-b42ee8f21842fab41a4cdf27960000bb1b3f42a7.tar.gz |
uci: Fix uci_delete() when ptr->value is empty string
After fix for deleting list elements by index this function was
broken and didn't allow to invoke from command line:
uci set some.fancy.list=''
i.e. list wasn't cleared
Signed-off-by: Krzysztof Kuźnik <k.kuznik@avsystem.com>
-rw-r--r-- | list.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -559,7 +559,7 @@ int uci_delete(struct uci_context *ctx, struct uci_ptr *ptr) UCI_ASSERT(ctx, ptr->s); - if (ptr->value && ptr->o && ptr->o->type == UCI_TYPE_LIST) { + if (ptr->value && *ptr->value && ptr->o && ptr->o->type == UCI_TYPE_LIST) { if (!sscanf(ptr->value, "%d", &index)) return 1; |