aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winprefs.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/winprefs.c')
-rw-r--r--xorg-server/hw/xwin/winprefs.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/xorg-server/hw/xwin/winprefs.c b/xorg-server/hw/xwin/winprefs.c
index 2472ea5aa..3becb436a 100644
--- a/xorg-server/hw/xwin/winprefs.c
+++ b/xorg-server/hw/xwin/winprefs.c
@@ -56,6 +56,8 @@ extern DWORD g_dwCurrentThreadID;
extern const char *winGetBaseDir(void);
+extern const char *g_pszLogFile;
+
/* From winmultiwindowflex.l, the real parser */
extern void parse_file (FILE *fp);
@@ -785,12 +787,9 @@ LoadPreferences (void)
/* Setup a DISPLAY environment variable, need to allocate on heap */
/* because putenv doesn't copy the argument... Always use screen 0 */
winGetDisplayName(szDisplay, 0);
- szEnvDisplay = (char *)(malloc(strlen(szDisplay)+strlen("DISPLAY=")+1));
- if (szEnvDisplay)
- {
- snprintf(szEnvDisplay, 512, "DISPLAY=%s", szDisplay);
- putenv (szEnvDisplay);
- }
+ szEnvDisplay = (char *)(malloc(strlen(szDisplay)+9/*strlen("DISPLAY=")+1*/));
+ snprintf(szEnvDisplay, 512, "DISPLAY=%s", szDisplay);
+ putenv (szEnvDisplay);
/* Replace any "%display%" in menu commands with display string */
for (i=0; i<pref.menuItems; i++)
@@ -808,6 +807,12 @@ LoadPreferences (void)
dstParam += strlen(szDisplay);
srcParam += 9;
}
+ else if (!strncmp(srcParam, "%logfile%", 9))
+ {
+ memcpy (dstParam, g_pszLogFile, strlen(g_pszLogFile));
+ dstParam += strlen(g_pszLogFile);
+ srcParam += 9;
+ }
else
{
*dstParam = *srcParam;