From ec55c94dfe1bf43ece808d984c672602faddd91b Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Tue, 8 Nov 2011 14:14:19 -0800 Subject: 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 --- startx.cpp | 25 +++++++++++++++++-------- 1 file 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 -- cgit v1.2.3