summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-11-08 14:14:19 -0800
committerJeremy Huddleston <jeremyhu@apple.com>2011-11-08 14:14:19 -0800
commitec55c94dfe1bf43ece808d984c672602faddd91b (patch)
tree4b1eeb6d4770a24de19496d91b6fa11b1dc44fc1
parent98b85a1ac235dbf421d1a49b41599e8bcaf490d3 (diff)
Use default clientargs, serverargs, and display if none were set
Previously, we did not use the default values unless server or client weren't set, but we should still use the defaults if they were not set but the server was. This is most evident when you want to tell startx which server to use, but you want startx to figure out which display to use automatically. This fixes a regression introduced by the previous patch on XQuartz: http://xquartz.macosforge.org/trac/ticket/523 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--startx.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/startx.cpp b/startx.cpp
index 9135da8..c92c51c 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -201,7 +201,7 @@ XCOMM process client arguments
if [ x"$client" = x ]; then
client=$defaultclient
- XCOMM if no client arguments either, use rc file instead
+ XCOMM For compatibility reasons, only use startxrc if there were no client command line arguments
if [ x"$clientargs" = x ]; then
if [ -f "$userclientrc" ]; then
client=$userclientrc
@@ -214,29 +214,38 @@ if [ x"$client" = x ]; then
client=$scosysclientrc
#endif
fi
-
- clientargs=$defaultclientargs
fi
fi
+XCOMM if no client arguments, use defaults
+if [ x"$clientargs" = x ]; then
+ clientargs=$defaultclientargs
+fi
+
XCOMM process server arguments
if [ x"$server" = x ]; then
server=$defaultserver
- XCOMM if no server arguments or display either, use defaults
+ XCOMM For compatibility reasons, only use xserverrc if there were no server command line arguments
if [ x"$serverargs" = x -a x"$display" = x ]; then
- XCOMM For compatibility reasons, only use xserverrc if there were no server command line arguments
if [ -f "$userserverrc" ]; then
server=$userserverrc
elif [ -f "$sysserverrc" ]; then
server=$sysserverrc
fi
-
- serverargs=$defaultserverargs
- display=$defaultdisplay
fi
fi
+XCOMM if no server arguments, use defaults
+if [ x"$serverargs" = x ]; then
+ serverargs=$defaultserverargs
+fi
+
+XCOMM if no display, use default
+if [ x"$display" = x ]; then
+ display=$defaultdisplay
+fi
+
if [ x"$enable_xauth" = x1 ] ; then
if [ x"$XAUTHORITY" = x ]; then
XAUTHORITY=$HOME/.Xauthority