summary refs log tree commit diff
diff options
context:
space:
mode:
authorJan Kryl <jan.kryl@nexenta.com>2017-05-08 11:38:37 +0200
committerPeter Stephenson <pws@zsh.org>2017-05-08 18:03:05 +0100
commit51eff6168e40d760bdb715bc6fc5420d26449c4c (patch)
tree49f0261b1719d13574221bec8fd72e91dec81f6d
parentaf1c82d646d2f1fa9cecbfcffd0159cc3cebe237 (diff)
downloadzsh-51eff6168e40d760bdb715bc6fc5420d26449c4c.tar.gz
zsh-51eff6168e40d760bdb715bc6fc5420d26449c4c.tar.xz
zsh-51eff6168e40d760bdb715bc6fc5420d26449c4c.zip
41095: Use 2>&- in completion to avoide restricted shell problem.
-rw-r--r--ChangeLog3
-rw-r--r--Completion/compinit2
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index bc7f3d7bb..00e335f6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2017-05-08  Peter Stephenson  <p.stephenson@samsung.com>
 
+	* 41059: Completion/compinit: use 2>&- to avoid error in
+	restricted shell.
+
 	* 41073: Src/parse.c, Test/A04redirect.ztst: off-by-one error
 	checking for {varid} syntax.
 
diff --git a/Completion/compinit b/Completion/compinit
index eb88a9fb9..c345ceb43 100644
--- a/Completion/compinit
+++ b/Completion/compinit
@@ -171,7 +171,7 @@ 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\'';
-             builtin enable -p \| \~ \( \? \* \[ \< \^ \# 2>/dev/null;
+             builtin enable -p \| \~ \( \? \* \[ \< \^ \# 2>&-;
              exec </dev/null;
              trap - ZERR;
              local -a reply;