summaryrefslogtreecommitdiff
path: root/src/XF86Config-parser/Write.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/XF86Config-parser/Write.c')
-rw-r--r--src/XF86Config-parser/Write.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/XF86Config-parser/Write.c b/src/XF86Config-parser/Write.c
index 12d78f7..98b1dd6 100644
--- a/src/XF86Config-parser/Write.c
+++ b/src/XF86Config-parser/Write.c
@@ -98,13 +98,17 @@ int xconfigWriteConfigFile (const char *filename, XConfigPtr cptr)
xconfigPrintLayoutSection (cf, cptr->layouts);
- fprintf (cf, "Section \"Files\"\n");
- xconfigPrintFileSection (cf, cptr->files);
- fprintf (cf, "EndSection\n\n");
+ if (cptr->files) {
+ fprintf (cf, "Section \"Files\"\n");
+ xconfigPrintFileSection (cf, cptr->files);
+ fprintf (cf, "EndSection\n\n");
+ }
- fprintf (cf, "Section \"Module\"\n");
- xconfigPrintModuleSection (cf, cptr->modules);
- fprintf (cf, "EndSection\n\n");
+ if (cptr->modules) {
+ fprintf (cf, "Section \"Module\"\n");
+ xconfigPrintModuleSection (cf, cptr->modules);
+ fprintf (cf, "EndSection\n\n");
+ }
xconfigPrintVendorSection (cf, cptr->vendors);