int changes = 0;
/* make sure no memory from previous parse attempts is leaked */
- ctx->internal = true;
uci_cleanup(ctx);
pctx = (struct uci_parse_context *) uci_malloc(ctx, sizeof(struct uci_parse_context));
}
/* no error happened, we can get rid of the parser context now */
- ctx->internal = true;
uci_cleanup(ctx);
return changes;
}
FILE *f = NULL;
int changes = 0;
- if (!p->confdir)
+ if (!p->has_history)
return 0;
uci_foreach_element(&ctx->history_path, e) {
uci_foreach_element_safe(&list, tmp, e) {
uci_free_element(e);
}
- ctx->internal = true;
uci_cleanup(ctx);
}
UCI_ASSERT(ctx, pkg != NULL);
p = *pkg;
UCI_ASSERT(ctx, p != NULL);
- UCI_ASSERT(ctx, p->confdir);
+ UCI_ASSERT(ctx, p->has_history);
/*
* - flush unwritten changes
* directly.
* does not modify the uci_package pointer
*/
- if (!p->confdir)
+ if (!p->has_history)
return uci_commit(ctx, &p, false);
if (uci_list_empty(&p->history))