X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=file.c;h=ae58fbc6ed9982c495aa84e8fa3f7260b60782dd;hp=8e7f0ce82b2a2e6790bb0e8c762833df00953f3a;hb=402b084b1e5417dc2fb7d84373c1b9fb8642696a;hpb=4b1ddfb8358bcd57560406db26d7041c9c0cb90b;ds=sidebyside diff --git a/file.c b/file.c index 8e7f0ce..ae58fbc 100644 --- a/file.c +++ b/file.c @@ -373,7 +373,6 @@ static void uci_fixup_section(struct uci_context *ctx, struct uci_section *s) static void uci_parse_config(struct uci_context *ctx, char **str) { struct uci_parse_context *pctx = ctx->pctx; - struct uci_section *s; char *name = NULL; char *type = NULL; @@ -524,7 +523,7 @@ static void uci_export_package(struct uci_package *p, FILE *stream, bool header) uci_foreach_element(&p->sections, s) { struct uci_section *sec = uci_to_section(s); fprintf(stream, "\nconfig '%s'", uci_escape(ctx, sec->type)); - if (!sec->anonymous) + if (!sec->anonymous || (ctx->flags & UCI_FLAG_EXPORT_NAME)) fprintf(stream, " '%s'", uci_escape(ctx, sec->e.name)); fprintf(stream, "\n"); uci_foreach_element(&sec->options, o) {