add missing check
authorFelix Fietkau <nbd@openwrt.org>
Mon, 28 Jan 2008 03:37:11 +0000 (04:37 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 28 Jan 2008 03:37:11 +0000 (04:37 +0100)
file.c

diff --git a/file.c b/file.c
index e9a8f90..772cf25 100644 (file)
--- a/file.c
+++ b/file.c
@@ -463,7 +463,8 @@ static void uci_export_package(struct uci_package *p, FILE *stream, bool header)
        struct uci_context *ctx = p->ctx;
        struct uci_element *s, *o;
 
        struct uci_context *ctx = p->ctx;
        struct uci_element *s, *o;
 
-       fprintf(stream, "package '%s'\n", uci_escape(ctx, p->e.name));
+       if (header)
+               fprintf(stream, "package '%s'\n", uci_escape(ctx, p->e.name));
        uci_foreach_element(&p->sections, s) {
                struct uci_section *sec = uci_to_section(s);
                fprintf(stream, "\nconfig '%s'", uci_escape(ctx, sec->type));
        uci_foreach_element(&p->sections, s) {
                struct uci_section *sec = uci_to_section(s);
                fprintf(stream, "\nconfig '%s'", uci_escape(ctx, sec->type));