1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

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

This commit is contained in:
William Ting 2012-03-15 13:06:45 -10:00
parent cdc171b272
commit a7c9575bce
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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