summaryrefslogtreecommitdiff
path: root/Functions
diff options
context:
space:
mode:
authorPeter Stephenson <p.stephenson@samsung.com>2018-06-25 09:31:40 +0100
committerPeter Stephenson <p.stephenson@samsung.com>2018-06-25 09:31:40 +0100
commit0a6cb5078d223288f9d3ab779fcc57370a10a6bb (patch)
treed7f71365241d8db549286fb2a3e7d5bf893f2f83 /Functions
parent3c57f71668950ef26de9c538ba32438db18f185c (diff)
downloadzsh-0a6cb5078d223288f9d3ab779fcc57370a10a6bb.tar.gz
zsh-0a6cb5078d223288f9d3ab779fcc57370a10a6bb.zip
43084: Variable warning suppression enhancements.
Add vared -g option along the lines of typeset -g. Set reply safely in zsh_directory_name_cdr.
Diffstat (limited to 'Functions')
-rw-r--r--Functions/Chpwd/zsh_directory_name_cdr5
1 files changed, 2 insertions, 3 deletions
diff --git a/Functions/Chpwd/zsh_directory_name_cdr b/Functions/Chpwd/zsh_directory_name_cdr
index c9be7db0c..cb72e4600 100644
--- a/Functions/Chpwd/zsh_directory_name_cdr
+++ b/Functions/Chpwd/zsh_directory_name_cdr
@@ -1,14 +1,13 @@
if [[ $1 = n ]]; then
if [[ $2 = <-> ]]; then
# Recent directory
- typeset -ga reply
autoload -Uz cdr
cdr -r
if [[ -n ${reply[$2]} ]]; then
- reply=(${reply[$2]})
+ typeset -ga reply=(${reply[$2]})
return 0
else
- reply=()
+ typeset -ga reply=()
return 1
fi
fi