}
}
if (!exists)
- UCI_INTERNAL(uci_add_delta_path, ctx, dir);
- else
- uci_list_add(&ctx->delta_path, &e->list);
+ e = uci_alloc_generic(ctx, UCI_TYPE_PATH, dir, sizeof(struct uci_element));
+ uci_list_add(&ctx->delta_path, &e->list);
sdir = uci_strdup(ctx, dir);
if (ctx->savedir != uci_savedir)
int c;
UCI_INTERNAL(uci_parse_argument, ctx, ctx->pctx->file, &str, &arg);
+ if (str && *str) {
+ goto error;
+ }
for (c = 0; c <= __UCI_CMD_LAST; c++) {
if (uci_command_char[c] == *arg)
break;
goto error;
if (ptr->flags & UCI_LOOKUP_EXTENDED)
goto error;
+ if (c != UCI_CMD_REMOVE && !ptr->value) {
+ goto error;
+ }
switch(c) {
case UCI_CMD_REORDER:
UCI_TRAP_SAVE(ctx, done);
stream = uci_open_stream(ctx, filename, NULL, SEEK_SET, flush, false);
+ UCI_TRAP_RESTORE(ctx);
+
if (p)
changes = uci_parse_delta(ctx, stream, p);
- UCI_TRAP_RESTORE(ctx);
+
done:
if (f)
*f = stream;
- else if (stream)
+ else
uci_close_stream(stream);
return changes;
}