--- gdm-2.4.4.2/config/Xsession.in 2003-08-18 21:31:08 +0400 +++ gdm-2.4.4.2/config/Xsession.in.alt 2003-09-26 01:59:24 +0400 @@ -26,14 +26,22 @@ # this will go into the .xsession-errors along with all other echo's # good for debugging where things went wrong + +SourceIfNotEmpty() +{ + local f="$1" + shift + [ -s "$f" ] && . "$f" "$@" +} + echo "$0: Beginning session setup..." # First read /etc/profile and .profile -test -f /etc/profile && . /etc/profile -test -f "$HOME/.profile" && . "$HOME/.profile" +SourceIfNotEmpty /etc/profile "$@" +SourceIfNotEmpty "$HOME"/.profile "$@" # Second read /etc/xprofile and .xprofile for X specific setup -test -f /etc/xprofile && . /etc/xprofile -test -f "$HOME/.xprofile" && . "$HOME/.xprofile" +SourceIfNotEmpty /etc/xprofile "$@" +SourceIfNotEmpty "$HOME"/.xprofile "$@" # Translation stuff if [ -x "@EXPANDED_LIBEXECDIR@/gdmtranslate" ] ; then @@ -197,8 +205,6 @@ command="$HOME/.Xclients" elif [ -x /etc/X11/xinit/Xclients ]; then command="/etc/X11/xinit/Xclients" - elif [ -x /etc/X11/Xclients ]; then - command="/etc/X11/Xclients" else echo "$0: Cannot find Xclients" # FIXME: kind of an evil failsafe