mharris bb63c20
--- hw/xfree86/parser/write.c.orig	2006-07-12 11:15:49.000000000 -0400
mharris bb63c20
+++ hw/xfree86/parser/write.c	2006-07-12 11:19:59.000000000 -0400
mharris bb63c20
@@ -108,13 +108,19 @@
mharris bb63c20
 
mharris bb63c20
 	xf86printLayoutSection (cf, cptr->conf_layout_lst);
mharris bb63c20
 
mharris bb63c20
-	fprintf (cf, "Section \"Files\"\n");
mharris bb63c20
-	xf86printFileSection (cf, cptr->conf_files);
mharris bb63c20
-	fprintf (cf, "EndSection\n\n");
mharris bb63c20
-
mharris bb63c20
-	fprintf (cf, "Section \"Module\"\n");
mharris bb63c20
-	xf86printModuleSection (cf, cptr->conf_modules);
mharris bb63c20
-	fprintf (cf, "EndSection\n\n");
mharris bb63c20
+	if (cptr->conf_files != NULL)
mharris bb63c20
+	{
mharris bb63c20
+		fprintf (cf, "Section \"Files\"\n");
mharris bb63c20
+		xf86printFileSection (cf, cptr->conf_files);
mharris bb63c20
+		fprintf (cf, "EndSection\n\n");
mharris bb63c20
+	}
mharris bb63c20
+
mharris bb63c20
+	if (cptr->conf_modules != NULL)
mharris bb63c20
+	{
mharris bb63c20
+		fprintf (cf, "Section \"Module\"\n");
mharris bb63c20
+		xf86printModuleSection (cf, cptr->conf_modules);
mharris bb63c20
+		fprintf (cf, "EndSection\n\n");
mharris bb63c20
+	}
mharris bb63c20
 
mharris bb63c20
 	xf86printVendorSection (cf, cptr->conf_vendor_lst);
mharris bb63c20