summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/doc/sgml/DESIGN.xml5
-rw-r--r--hw/xfree86/parser/scan.c23
2 files changed, 10 insertions, 18 deletions
diff --git a/hw/xfree86/doc/sgml/DESIGN.xml b/hw/xfree86/doc/sgml/DESIGN.xml
index 826a9702c..6c90a4011 100644
--- a/hw/xfree86/doc/sgml/DESIGN.xml
+++ b/hw/xfree86/doc/sgml/DESIGN.xml
@@ -118,8 +118,9 @@ routines common to all the X servers in the sample implementation.
<title>The xorg.conf File</title>
<para>
-The xorg.conf file format is similar to the old format, with the following
-changes:
+The xorg.conf file format is based on the XF86Config format from XFree86 4.4,
+which is in turn similar to the old XFree86 3.x XF86Config format, with the
+following changes:
</para>
<sect2>
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index 06710d55a..9771913f4 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -601,7 +601,7 @@ xf86pathIsSafe(const char *path)
* %P projroot
* %C sysconfdir
* %D datadir
- * %M major version number
+ * %M config file format version number
* %% %
*/
@@ -627,16 +627,10 @@ xf86pathIsSafe(const char *path)
#define XCONFENV "XORGCONFIG"
#endif
#define XFREE86CFGFILE "XF86Config"
-#ifndef XF86_VERSION_MAJOR
-#ifdef XVERSION
-#if XVERSION > 40000000
-#define XF86_VERSION_MAJOR (XVERSION / 10000000)
-#else
-#define XF86_VERSION_MAJOR (XVERSION / 1000)
-#endif
-#else
-#define XF86_VERSION_MAJOR 4
-#endif
+/* xorg.conf is based on XF86Config version 4. If we ever break
+ compatibility of the xorg.conf syntax, we'll bump this version number. */
+#ifndef CONFIG_FILE_VERSION
+#define CONFIG_FILE_VERSION 4
#endif
#define BAIL_OUT do { \
@@ -771,11 +765,8 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot,
break;
case 'M':
if (!majorvers[0]) {
- if (XF86_VERSION_MAJOR < 0 || XF86_VERSION_MAJOR > 99) {
- fprintf(stderr, "XF86_VERSION_MAJOR is out of range\n");
- BAIL_OUT;
- } else
- sprintf(majorvers, "%d", XF86_VERSION_MAJOR);
+ snprintf(majorvers, sizeof(majorvers),
+ "%d", CONFIG_FILE_VERSION);
}
APPEND_STR(majorvers);
break;