X-Git-Url: http://git.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=list.c;h=cd995fee2ff931da9d55d40f882555dc4e48058f;hp=352596d02642d8f56379728e16b43abd687c7e21;hb=e0a0a4bf8a3861ab811487706e1773212a8ffabd;hpb=83300a90f50a2af5592edbfb2952ac4009041d20 diff --git a/list.c b/list.c index 352596d..cd995fe 100644 --- a/list.c +++ b/list.c @@ -667,6 +667,11 @@ int uci_set(struct uci_context *ctx, struct uci_ptr *ptr) ptr->o = uci_to_option(e); } if (!ptr->value[0]) { + /* if setting a nonexistant option/section to a nonexistant value, + * exit without errors */ + if (!(ptr->flags & UCI_LOOKUP_COMPLETE)) + return 0; + return uci_delete(ctx, ptr); } else if (!ptr->o && ptr->option) { /* new option */ ptr->o = uci_alloc_option(ptr->s, ptr->option, ptr->value);