Do not leak a variable: cdpath_dir.

Leaking a variable that holds a path in CDPATH could easily end up appearing on your prompt like `~cdpath_dir/subdir`.
This commit is contained in:
Akinori MUSHA 2013-10-21 21:18:38 +09:00
parent dbd27cb30a
commit 0fc6b07509

View file

@ -164,6 +164,7 @@ _zsh_highlight_main_highlighter_check_path()
[[ -z $expanded_path ]] && return 1
[[ -e $expanded_path ]] && return 0
# Search the path in CDPATH
local cdpath_dir
for cdpath_dir in $cdpath ; do
[[ -e "$cdpath_dir/$expanded_path" ]] && return 0
done