xserver: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Tue Apr 10 02:17:53 EEST 2007


 hw/xfree86/parser/write.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

New commits:
diff-tree 72b477f964c748a1ab668781643cc11877f19738 (from 1f6741db19d4c91b1eacb497dff1814acb1bf0c3)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date:   Mon Apr 9 18:59:01 2007 -0400

    Don't write out empty sections from the parser.

diff --git a/hw/xfree86/parser/write.c b/hw/xfree86/parser/write.c
index 1869f56..3924001 100644
--- a/hw/xfree86/parser/write.c
+++ b/hw/xfree86/parser/write.c
@@ -107,13 +107,19 @@ doWriteConfigFile (const char *filename,
 
 	xf86printLayoutSection (cf, cptr->conf_layout_lst);
 
-	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_files != NULL)
+	{
+		fprintf (cf, "Section \"Files\"\n");
+		xf86printFileSection (cf, cptr->conf_files);
+		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);
 



More information about the xorg-commit mailing list