[xorg-commit-diffs]
xc/programs/Xserver/hw/xfree86/parser Imakefile, 1.1.4.1,
1.1.4.2 Monitor.c, 1.1.4.1, 1.1.4.2 scan.c, 1.1.4.1, 1.1.4.2
Egbert Eich
xorg-commit at pdx.freedesktop.org
Thu Apr 15 03:17:17 PDT 2004
Committed by: eich
Update of /cvs/xorg/xc/programs/Xserver/hw/xfree86/parser
In directory pdx:/home/eich/tstbuild/xc/programs/Xserver/hw/xfree86/parser
Modified Files:
Tag: XORG-CURRENT
Imakefile Monitor.c scan.c
Log Message:
2004-04-15 Egbert Eich <eich at freedesktop.org>
Merged changes from RELEASE-1 branch
Index: Imakefile
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/parser/Imakefile,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/Imakefile 5 Mar 2004 13:40:57 -0000 1.1.4.1
+++ b/Imakefile 15 Apr 2004 10:17:10 -0000 1.1.4.2
@@ -20,7 +20,11 @@
XCONFIGFILE = XConfigFile
XCONFIGDIR = XConfigDir
+#if defined XFree86Version
XVERS = XFree86Version
+#elif defined (XorgVersion)
+XVERS = XorgVersion
+#endif
INCLUDES = -I. -I$(XF86OSSRC)
Index: Monitor.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/parser/Monitor.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/Monitor.c 26 Nov 2003 22:49:02 -0000 1.1.4.1
+++ b/Monitor.c 15 Apr 2004 10:17:10 -0000 1.1.4.2
@@ -671,15 +671,17 @@
fprintf (cf, "\tDisplaySize %d\t%d\n",
ptr->mon_width,
ptr->mon_height);
+ if ( ptr->mon_n_hsync || ptr->mon_n_vrefresh )
+ fprintf(cf," ### Uncomment if you don't want to default to DDC:\n");
for (i = 0; i < ptr->mon_n_hsync; i++)
{
- fprintf (cf, "\tHorizSync %2.1f - %2.1f\n",
+ fprintf (cf, "#\tHorizSync %2.1f - %2.1f\n",
ptr->mon_hsync[i].lo,
ptr->mon_hsync[i].hi);
}
for (i = 0; i < ptr->mon_n_vrefresh; i++)
{
- fprintf (cf, "\tVertRefresh %2.1f - %2.1f\n",
+ fprintf (cf, "#\tVertRefresh %2.1f - %2.1f\n",
ptr->mon_vrefresh[i].lo,
ptr->mon_vrefresh[i].hi);
}
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.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/scan.c 26 Nov 2003 22:49:02 -0000 1.1.4.1
+++ b/scan.c 15 Apr 2004 10:17:10 -0000 1.1.4.2
@@ -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