summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xfree86/parser/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/parser/scan.c')
-rw-r--r--xc/programs/Xserver/hw/xfree86/parser/scan.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/parser/scan.c b/xc/programs/Xserver/hw/xfree86/parser/scan.c
index 8018c5fda..6d8e1b922 100644
--- a/xc/programs/Xserver/hw/xfree86/parser/scan.c
+++ b/xc/programs/Xserver/hw/xfree86/parser/scan.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/scan.c,v 1.10 2000/03/02 17:53:13 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/scan.c,v 1.12 2000/04/05 18:13:57 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -94,7 +94,7 @@ StrToUL (char *str)
if (*p == '0')
{
p++;
- if (*p == 'x')
+ if ((*p == 'x') || (*p == 'X'))
{
p++;
base = 16;
@@ -205,7 +205,7 @@ xf86GetToken (xf86ConfigSymTabRec * tab)
configRBuf[0] = c;
i = 1;
while (isdigit (c = configBuf[configPos++]) ||
- (c == '.') || (c == 'x') ||
+ (c == '.') || (c == 'x') || (c == 'X') ||
((base == 16) && (((c >= 'a') && (c <= 'f')) ||
((c >= 'A') && (c <= 'F')))))
configRBuf[i++] = c;
@@ -359,6 +359,7 @@ PathIsSafe(const char *path)
* %P projroot
* %M major version number
* %% %
+ * %& EMX only: prepend X11ROOT env var
*/
#ifndef XCONFIGFILE
@@ -407,6 +408,9 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot,
static const char *env = NULL, *home = NULL;
static char *hostname = NULL;
static char majorvers[3] = "";
+#ifdef __EMX__
+ static char *x11root = NULL;
+#endif
if (!template)
return NULL;
@@ -523,6 +527,16 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot,
result[l++] = '%';
CHECK_LENGTH;
break;
+#ifdef __EMX__
+ case '&':
+ if (!x11root)
+ x11root = getenv("X11ROOT");
+ if (x11root)
+ APPEND_STR(x11root);
+ else
+ BAIL_OUT;
+ break;
+#endif
default:
fprintf(stderr, "invalid escape %%%c found in path template\n",
template[i]);