diff options
author | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-04-09 18:59:01 -0400 |
---|---|---|
committer | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-04-09 18:59:01 -0400 |
commit | 72b477f964c748a1ab668781643cc11877f19738 (patch) | |
tree | 7f061d0b41ebce5a49083b63a06c584f4021bf7f /hw/xfree86/parser | |
parent | 1f6741db19d4c91b1eacb497dff1814acb1bf0c3 (diff) |
Don't write out empty sections from the parser.
Diffstat (limited to 'hw/xfree86/parser')
-rw-r--r-- | hw/xfree86/parser/write.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/hw/xfree86/parser/write.c b/hw/xfree86/parser/write.c index 1869f56a6..3924001f7 100644 --- a/hw/xfree86/parser/write.c +++ b/hw/xfree86/parser/write.c @@ -107,13 +107,19 @@ doWriteConfigFile (const char *filename, XF86ConfigPtr cptr) xf86printLayoutSection (cf, cptr->conf_layout_lst); - fprintf (cf, "Section \"Files\"\n"); - xf86printFileSection (cf, cptr->conf_files); - fprintf (cf, "EndSection\n\n"); + if (cptr->conf_files != NULL) + { + fprintf (cf, "Section \"Files\"\n"); + xf86printFileSection (cf, cptr->conf_files); + fprintf (cf, "EndSection\n\n"); + } - fprintf (cf, "Section \"Module\"\n"); - xf86printModuleSection (cf, cptr->conf_modules); - fprintf (cf, "EndSection\n\n"); + if (cptr->conf_modules != NULL) + { + fprintf (cf, "Section \"Module\"\n"); + xf86printModuleSection (cf, cptr->conf_modules); + fprintf (cf, "EndSection\n\n"); + } xf86printVendorSection (cf, cptr->conf_vendor_lst); |