Do quote section names to keep the same style as option values
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 24 Feb 2012 14:08:34 +0000 (15:08 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 24 Feb 2012 14:08:34 +0000 (15:08 +0100)
file.c

diff --git a/file.c b/file.c
index b471307cddf4308e7a19dc4150943c94054549c5..c2b0e721da417cbbf000252cca3c0d2d83e4e992 100644 (file)
--- a/file.c
+++ b/file.c
@@ -566,7 +566,7 @@ static void uci_export_package(struct uci_package *p, FILE *stream, bool header)
                struct uci_section *sec = uci_to_section(s);
                fprintf(stream, "\nconfig %s", uci_escape(ctx, sec->type));
                if (!sec->anonymous || (ctx->flags & UCI_FLAG_EXPORT_NAME))
-                       fprintf(stream, " %s", uci_escape(ctx, sec->e.name));
+                       fprintf(stream, " '%s'", uci_escape(ctx, sec->e.name));
                fprintf(stream, "\n");
                uci_foreach_element(&sec->options, o) {
                        struct uci_option *opt = uci_to_option(o);