summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2016-04-15 21:39:04 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2016-04-15 21:39:04 -0700
commit5e71690c1993100032a8e15ee937865aaa2350c4 (patch)
tree76621ebe3078e4a2a643924b83314d56bc9ba9f5
parent67c017409367fc895fd73d5a73b40332daaeb545 (diff)
downloadzsh-5e71690c1993100032a8e15ee937865aaa2350c4.tar.gz
zsh-5e71690c1993100032a8e15ee937865aaa2350c4.zip
38289: "builtin enable" in $_comp_setup to avoid accidentally invoking external command of the same name
-rw-r--r--ChangeLog5
-rw-r--r--Completion/compinit8
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 047fd0f30..219d55608 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-04-15 Barton E. Schaefer <schaefer@zsh.org>
+
+ * 38289: Completion/compinit: "builtin enable" in $_comp_setup
+ to avoid accidentally invoking external command of the same name
+
2016-04-14 Oliver Kiddle <opk@zsh.org>
* Han Pingtian: 38219: Completion/Zsh/Context/_subscript:
diff --git a/Completion/compinit b/Completion/compinit
index 4b9a77853..6612baca0 100644
--- a/Completion/compinit
+++ b/Completion/compinit
@@ -167,11 +167,11 @@ _comp_options=(
typeset -gH _comp_setup='local -A _comp_caller_options;
_comp_caller_options=(${(kv)options[@]});
setopt localoptions localtraps localpatterns ${_comp_options[@]};
- local IFS=$'\'\ \\t\\r\\n\\0\''
- enable -p \| \~ \( \? \* \[ \< \^ \#
+ local IFS=$'\'\ \\t\\r\\n\\0\'';
+ builtin enable -p \| \~ \( \? \* \[ \< \^ \# 2>/dev/null;
exec </dev/null;
- trap - ZERR
- local -a reply
+ trap - ZERR;
+ local -a reply;
local REPLY'
# These can hold names of functions that are to be called before/after all