summaryrefslogtreecommitdiff
authorJeremy Huddleston <jeremyhu@freedesktop.org>2008-12-28 09:53:38 (GMT)
committer Jeremy Huddleston <jeremyhu@freedesktop.org>2008-12-29 06:17:26 (GMT)
commit338f096861136fb6c4f604e93ff21277252676b7 (patch) (side-by-side diff)
treeb9e9fa2b54528c45ae487a1b122a9c287c26ae0d
parent61ae56f97326c57dda05632ca9f4873238ee18e1 (diff)
downloadxserver-338f096861136fb6c4f604e93ff21277252676b7.zip
xserver-338f096861136fb6c4f604e93ff21277252676b7.tar.gz
XQuartz: Try harder to get the user's login environment
(cherry picked from commit 6bedaddd78aa04bd303df434a4c49bb87bd7deaa)
Diffstat (more/less context) (ignore whitespace changes)
-rwxr-xr-xhw/xquartz/bundle/X11.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/hw/xquartz/bundle/X11.sh b/hw/xquartz/bundle/X11.sh
index 4295da9..3b8b679 100755
--- a/hw/xquartz/bundle/X11.sh
+++ b/hw/xquartz/bundle/X11.sh
@@ -1,8 +1,15 @@
-#!/bin/bash --login
+#!/bin/bash
+
+set "$(dirname "$0")"/X11.bin "${@}"
if [ -x ~/.x11run ]; then
- exec ~/.x11run "$(dirname "$0")"/X11.bin "${@}"
-else
- exec "$(dirname "$0")"/X11.bin "${@}"
+ exec ~/.x11run "${@}"
fi
+case $(basename "${SHELL}") in
+ bash) exec -l "${SHELL}" --login -c 'exec "${@}"' - "${@}" ;;
+ ksh|sh|zsh) exec -l "${SHELL}" -c 'exec "${@}"' - "${@}" ;;
+ csh|tcsh) exec -l "${SHELL}" -c 'exec $argv:q' "${@}" ;;
+ es|rc) exec -l "${SHELL}" -l -c 'exec $*' "${@}" ;;
+ *) exec "${@}" ;;
+esac