1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-10-02 00:41:44 +02:00

use set -A' instead of eval' in more places (11525)

This commit is contained in:
Sven Wischnowsky 2000-05-23 08:54:30 +00:00
parent cb50583b18
commit ee681a32ad
6 changed files with 17 additions and 12 deletions

@ -1,5 +1,10 @@
2000-05-23 Sven Wischnowsky <wischnow@zsh.org>
* 11525: Completion/Base/_arguments, Completion/Commands/_complete_help,
Completion/Commands/_next_tags, Completion/Core/_description,
Completion/Core/_next_label: use `set -A' instead of `eval' in
more places
* 11524: Src/builtin.c: fix for read -q without a shout
* 11523: Src/hist.c, Src/init.c, Src/lex.c, Src/zsh.h, Src/Zle/zle.h,

@ -149,7 +149,7 @@ if (( long )); then
cache=( "$cache[@]" "$tmp[@]" )
fi
done
eval "${name}=( \"\${(@)cache:# #}\" )"
set -A "$name" "${(@)cache:# #}"
fi
set -- "$tmpargv[@]" "${(@P)name}"
fi

@ -32,7 +32,7 @@ _complete_help() {
# No need to call the completers more than once with different match specs.
if [[ "$3" = matcher-list ]]; then
eval "${4}=( '' )"
set -A "$4" ''
else
builtin zstyle "$@"
fi

@ -62,10 +62,10 @@ _next_tags() {
zformat -f descr "${curtag#*:}" "d:$3"
_description "$gopt" "${curtag%:*}" "$2" "$descr"
curtag="${curtag%:*}"
eval "${2}=( \${(P)2} \$argv[4,-1] )"
set -A "$2" "${(P@)2}" "${(@)argv[4,-1]}"
else
_description "$gopt" "$curtag" "$2" "$3"
eval "${2}=( \$argv[4,-1] \${(P)2} )"
set -A "$2" "${(@)argv[4,-1]}" "${(P@)2}"
fi
return 0

@ -26,8 +26,8 @@ fi
zstyle -s ":completion:${curcontext}:$1" group-name gname &&
[[ -z "$gname" ]] && gname="$1"
zstyle -s ":completion:${curcontext}:$1" matcher match &&
opts=($opts -M "${(q)match}")
[[ -n "$_matcher" ]] && opts=($opts -M "${(q)_matcher}")
opts=($opts -M "$match")
[[ -n "$_matcher" ]] && opts=($opts -M "$_matcher")
if [[ -z "$_comp_no_ignore" ]]; then
if zstyle -a ":completion:${curcontext}:$1" ignored-patterns _comp_ignore; then
@ -48,15 +48,15 @@ shift 2
if [[ -n "$gname" ]]; then
if [[ -n "$format" ]]; then
eval "${name}=($opts $gropt ${(q)gname} -X \"${format}\")"
set -A "$name" "$opts[@]" "$gropt" "$gname" -X "$format"
else
eval "${name}=($opts $gropt ${(q)gname})"
set -A "$name" "$opts[@]" "$gropt" "$gname"
fi
else
if [[ -n "$format" ]]; then
eval "${name}=($opts $gropt -default- -X \"${format}\")"
set -A "$name" "$opts[@]" "$gropt" -default- -X "$format"
else
eval "${name}=($opts $gropt -default-)"
set -A "$name" "$opts[@]" "$gropt" -default-
fi
fi

@ -13,10 +13,10 @@ if comptags -A "$1" curtag spec; then
zformat -f descr "${curtag#*:}" "d:$3"
_description "$gopt" "${curtag%:*}" "$2" "$descr"
curtag="${curtag%:*}"
set -A $2 "${(P@)2}" "${argv[4,-1][@]}"
set -A $2 "${(P@)2}" "${(@)argv[4,-1]}"
else
_description "$gopt" "$curtag" "$2" "$3"
set -A $2 "${argv[4,-1][@]}" "${(P@)2}"
set -A $2 "${(@)argv[4,-1]}" "${(P@)2}"
fi
return 0