s = uci_to_section(e);
section = e->name;
option = NULL;
+ /* matches the currently set value */
+ if (!strcmp(value, s->type))
+ return 0;
break;
case UCI_TYPE_OPTION:
UCI_ASSERT(ctx, value != NULL);
s = uci_to_option(e)->section;
section = s->e.name;
option = e->name;
+ /* matches the currently set value */
+ if (!strcmp(value, e->name))
+ return 0;
break;
default:
UCI_THROW(ctx, UCI_ERR_INVAL);
return 0;
}
-int uci_delete(struct uci_context *ctx, struct uci_package *p, char *section, char *option)
+int uci_delete(struct uci_context *ctx, struct uci_package *p, const char *section, const char *option)
{
/* NB: pass on internal flag to uci_del_element */
bool internal = ctx->internal;