aboutsummaryrefslogtreecommitdiff
path: root/scripts/vim-patch.sh
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2016-08-11 14:09:50 +0200
committerDaniel Hahler <git@thequod.de>2016-08-11 18:57:54 +0200
commit3e00dc44772407fc4393a6e12020a267b356d9bd (patch)
tree412e3e46d18eb52580612aaceea433a97d20db22 /scripts/vim-patch.sh
parentadd41dca98b748a84a022c828bc47e0e47e58332 (diff)
downloadrneovim-3e00dc44772407fc4393a6e12020a267b356d9bd.tar.gz
rneovim-3e00dc44772407fc4393a6e12020a267b356d9bd.tar.bz2
rneovim-3e00dc44772407fc4393a6e12020a267b356d9bd.zip
scripts/vim-patch.sh: use privileged mode (set -p)
Without this the "cd scripts/.." might change to another dir (since CDPATH is looked at before a local path), and then NEOVIM_SOURCE_DIR might end up being "/somewhere/else\n/somewhere/else" (since the "cd" prints the dir already in that case). Closes https://github.com/neovim/neovim/pull/5213.
Diffstat (limited to 'scripts/vim-patch.sh')
-rwxr-xr-xscripts/vim-patch.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index 3997bd52b1..b552874c27 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -3,6 +3,8 @@
set -e
set -u
set -o pipefail
+# Use priviledged mode, which e.g. skips using CDPATH.
+set -p
readonly NEOVIM_SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
readonly VIM_SOURCE_DIR_DEFAULT="${NEOVIM_SOURCE_DIR}/.vim-src"