char *name;
char *type;
- uci_fixup_section(ctx, ctx->pctx->section);
if (!ctx->pctx->package) {
if (!ctx->pctx->name)
uci_parse_error(ctx, "attempting to import a file without a package name");
UCI_THROW(ctx, ctx->err);
}
- uci_fixup_section(ctx, ctx->pctx->section);
if (!pctx->package && name)
uci_switch_config(ctx);
if (package)
}
/* fix up an unnamed section, e.g. after adding options to it */
-__private void uci_fixup_section(struct uci_context *ctx, struct uci_section *s)
+static void uci_fixup_section(struct uci_context *ctx, struct uci_section *s)
{
unsigned int hash = ~0;
struct uci_element *e;
UCI_HANDLE_ERR(ctx);
UCI_ASSERT(ctx, p != NULL);
s = uci_alloc_section(p, type, NULL);
- uci_fixup_section(ctx, s);
+ if (s && s->anonymous)
+ uci_fixup_section(ctx, s);
*res = s;
if (!internal && p->has_delta)
uci_add_delta(ctx, &p->delta, UCI_CMD_ADD, s->e.name, NULL, type);
__private void uci_cleanup(struct uci_context *ctx);
__private struct uci_element *uci_lookup_list(struct uci_list *list, const char *name);
-__private void uci_fixup_section(struct uci_context *ctx, struct uci_section *s);
__private void uci_free_package(struct uci_package **package);
__private struct uci_element *uci_alloc_generic(struct uci_context *ctx, int type, const char *name, int size);
__private void uci_free_element(struct uci_element *e);