[xorg-commit-diffs]
xc/programs/Xserver/hw/xfree86/parser Imakefile, 1.1.10.1,
1.1.10.1.6.1 scan.c, 1.1.4.1, 1.1.4.1.16.1
Roland Mainz
xorg-commit at pdx.freedesktop.org
Sat Apr 10 02:05:29 PDT 2004
Committed by: gisburn
Update of /cvs/xorg/xc/programs/Xserver/hw/xfree86/parser
In directory pdx:/tmp/cvs-serv7662/xc/programs/Xserver/hw/xfree86/parser
Modified Files:
Tag: XPRINT
Imakefile scan.c
Log Message:
Resync to 2004-04-10 XORG-RELEASE-1 branch
Index: Imakefile
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/parser/Imakefile,v
retrieving revision 1.1.10.1
retrieving revision 1.1.10.1.6.1
diff -u -d -r1.1.10.1 -r1.1.10.1.6.1
--- a/Imakefile 4 Mar 2004 17:48:13 -0000 1.1.10.1
+++ b/Imakefile 10 Apr 2004 09:05:25 -0000 1.1.10.1.6.1
@@ -20,7 +20,11 @@
XCONFIGFILE = XConfigFile
XCONFIGDIR = XConfigDir
+#if defined XFree86Version
XVERS = XFree86Version
+#elif defined (XorgVersion)
+XVERS = XorgVersion
+#endif
INCLUDES = -I. -I$(XF86OSSRC)
Index: scan.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/parser/scan.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.1.16.1
diff -u -d -r1.1.4.1 -r1.1.4.1.16.1
--- a/scan.c 26 Nov 2003 22:49:02 -0000 1.1.4.1
+++ b/scan.c 10 Apr 2004 09:05:25 -0000 1.1.4.1.16.1
@@ -440,11 +440,11 @@
* %A cmdline argument as an absolute path (must be absolute to match)
* %R cmdline argument as a relative path
* %S cmdline argument as a "safe" path (relative, and no ".." elements)
- * %X default config file name ("XF86Config")
+ * %X default config file name ("xorg.conf")
* %H hostname
- * %E config file environment ($XF86CONFIG) as an absolute path
- * %F config file environment ($XF86CONFIG) as a relative path
- * %G config file environment ($XF86CONFIG) as a safe path
+ * %E config file environment ($XORGCONFIG) as an absolute path
+ * %F config file environment ($XORGCONFIG) as a relative path
+ * %G config file environment ($XORGCONFIG) as a safe path
* %D $HOME
* %P projroot
* %M major version number
@@ -453,14 +453,15 @@
*/
#ifndef XCONFIGFILE
-#define XCONFIGFILE "XF86Config"
+#define XCONFIGFILE "xorg.conf"
#endif
#ifndef PROJECTROOT
#define PROJECTROOT "/usr/X11R6"
#endif
#ifndef XCONFENV
-#define XCONFENV "XF86CONFIG"
+#define XCONFENV "XORGCONFIG"
#endif
+#define XFREE86CFGFILE "XF86Config"
#ifndef XF86_VERSION_MAJOR
#ifdef XVERSION
#if XVERSION > 40000000
@@ -495,7 +496,7 @@
static char *
DoSubstitution(const char *template, const char *cmdline, const char *projroot,
- int *cmdlineUsed, int *envUsed)
+ int *cmdlineUsed, int *envUsed, char *XConfigFile)
{
char *result;
int i, l;
@@ -547,7 +548,7 @@
BAIL_OUT;
break;
case 'X':
- APPEND_STR(XCONFIGFILE);
+ APPEND_STR(XConfigFile);
break;
case 'H':
if (!hostname) {
@@ -701,7 +702,8 @@
/* First, search for a config file. */
while (template && !configFile) {
if ((configPath = DoSubstitution(template, cmdline, projroot,
- &cmdlineUsed, NULL))) {
+ &cmdlineUsed, NULL,
+ XCONFIGFILE))) {
if ((configFile = fopen(configPath, "r")) != 0) {
if (cmdline && !cmdlineUsed) {
fclose(configFile);
@@ -715,6 +717,31 @@
}
template = strtok(NULL, ",");
}
+
+ /* Then search for fallback */
+ if (!configFile) {
+ strcpy(pathcopy, path);
+ template = strtok(pathcopy, ",");
+
+ while (template && !configFile) {
+ if ((configPath = DoSubstitution(template, cmdline, projroot,
+ &cmdlineUsed, NULL,
+ XFREE86CFGFILE))) {
+ if ((configFile = fopen(configPath, "r")) != 0) {
+ if (cmdline && !cmdlineUsed) {
+ fclose(configFile);
+ configFile = NULL;
+ }
+ }
+ }
+ if (configPath && !configFile) {
+ xf86conffree(configPath);
+ configPath = NULL;
+ }
+ template = strtok(NULL, ",");
+ }
+ }
+
xf86conffree(pathcopy);
if (!configFile) {
More information about the xorg-commit-diffs
mailing list