fix bug where $XDG_DATA_HOME is not set properly when switching between users via su

pull/119/head
William Ting 12 years ago
parent cdc171b272
commit a7c9575bce

@ -47,8 +47,8 @@ EOF
complete -o default -o bashdefault -F _autojump_files cp mv meld diff kdiff3 vim emacs
#determine the data directory according to the XDG Base Directory Specification
if [ -n "$XDG_DATA_HOME" ]; then
export AUTOJUMP_DATA_DIR="$XDG_DATA_HOME/autojump"
if [[ -n ${XDG_DATA_HOME} ]] && [[ ${XDG_DATA_HOME} =~ ${USER} ]]; then
export AUTOJUMP_DATA_DIR="${XDG_DATA_HOME}/autojump"
else
export AUTOJUMP_DATA_DIR=~/.local/share/autojump
fi

@ -15,7 +15,7 @@
#along with autojump. If not, see <http://www.gnu.org/licenses/>.
# determine the data directory according to the XDG Base Directory Specification
if [[ -n ${XDG_DATA_HOME} ]]; then
if [[ -n ${XDG_DATA_HOME} ]] && [[ ${XDG_DATA_HOME} =~ ${USER} ]]; then
export AUTOJUMP_DATA_DIR="${XDG_DATA_HOME}/autojump"
else
export AUTOJUMP_DATA_DIR=${HOME}/.local/share/autojump

Loading…
Cancel
Save