From 491b4fd27b3776fe87c61b333fafd2d4b18ee641 Mon Sep 17 00:00:00 2001 From: benvb Date: Wed, 7 Jan 2015 16:47:33 -0500 Subject: [PATCH] Quote $XDG_DATA_HOME when setting error file I'm not sure if this is actually a bug in fish, but (test -d) with no argument returns true, and nonexistent environment variables return an empty string, so (test -d $XDG_DATA_HOME) returns true when $XDG_DATA_HOME isn't set. Prior to making this change, I would get an error from dirname when opening a shell and an error from fish when cd'ing. --- bin/autojump.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/autojump.fish b/bin/autojump.fish index b70c140..2cf5001 100644 --- a/bin/autojump.fish +++ b/bin/autojump.fish @@ -13,7 +13,7 @@ complete -x -c j -a '(autojump --complete (commandline -t))' # set error file location if test (uname) = "Darwin" set -x AUTOJUMP_ERROR_PATH ~/Library/autojump/errors.log -else if test -d $XDG_DATA_HOME +else if test -d "$XDG_DATA_HOME" set -x AUTOJUMP_ERROR_PATH $XDG_DATA_HOME/autojump/errors.log else set -x AUTOJUMP_ERROR_PATH ~/.local/share/autojump/errors.log