about summary refs log tree commit diff
path: root/Functions/Misc
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-10-29 15:01:07 +0000
committerPeter Stephenson <pws@zsh.org>2015-10-29 15:01:07 +0000
commit0628802baf5c9245138db82dd058cad023a7d0ae (patch)
treebdbc600fe01ccbac2fb1b34814626a53f909c806 /Functions/Misc
parent9640e9f497e8d78bf0bfa9defc4cfdeba1e7bfae (diff)
downloadzsh-0628802baf5c9245138db82dd058cad023a7d0ae.tar.gz
zsh-0628802baf5c9245138db82dd058cad023a7d0ae.tar.xz
zsh-0628802baf5c9245138db82dd058cad023a7d0ae.zip
37014: Improved internal parameter setting.
Enhance WARNCREATEGLOBAL to work in many more cases.

Don't create REPLY as an integer if it didn't previously exist
as one, even if the value to be set is integral, as this is likely to
mess up later uses of REPLY.
Diffstat (limited to 'Functions/Misc')
-rw-r--r--Functions/Misc/add-zsh-hook2
1 files changed, 2 insertions, 0 deletions
diff --git a/Functions/Misc/add-zsh-hook b/Functions/Misc/add-zsh-hook
index ee37d674d..fc39659ae 100644
--- a/Functions/Misc/add-zsh-hook
+++ b/Functions/Misc/add-zsh-hook
@@ -82,9 +82,11 @@ if (( del )); then
 else
   if (( ${(P)+hook} )); then
     if (( ${${(P)hook}[(I)$fn]} == 0 )); then
+      typeset -ga $hook
       set -A $hook ${(P)hook} $fn
     fi
   else
+    typeset -ga $hook
     set -A $hook $fn
   fi
   autoload $autoopts -- $fn