mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-10-02 08:51:18 +02:00
12133: Protect completion system from stray error output and assorted fatal
errors when expanding strings taken from the command line.
This commit is contained in:
parent
0f398e9d2f
commit
4ed8c26c50
@ -1,3 +1,10 @@
|
||||
2000-07-02 Bart Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 12133: Completion/Core/_expand, Completion/Core/_path_files:
|
||||
Discard error output from parameter expansions and use "eval" to
|
||||
protect the completion system from parse errors and other garbage
|
||||
in the strings taken from the command line.
|
||||
|
||||
2000-06-29 Sven Wischnowsky <wischnow@zsh.org>
|
||||
|
||||
* 12125: Src/parse.c, Test/09funcdef.ztst: fix for `foo () print
|
||||
|
@ -63,7 +63,7 @@ if [[ "$force" = *s* ]] ||
|
||||
eval exp\=\( ${${(q)exp}:gs/\\{/\{/:gs/\\}/\}/} \)
|
||||
exp=( ${${(e)exp//\\[
|
||||
]/ }//(#b)([
|
||||
])/\\$match[1]} )
|
||||
])/\\$match[1]} ) 2>/dev/null
|
||||
else
|
||||
exp=( ${exp:s/\\\$/\$} )
|
||||
fi
|
||||
@ -77,7 +77,7 @@ subd=("$exp[@]")
|
||||
# Now try globbing.
|
||||
|
||||
[[ "$force" = *g* ]] || zstyle -T ":completion:${curcontext}:" glob &&
|
||||
exp=( ${~exp} )
|
||||
eval 'exp=( ${~exp} )' 2>/dev/null
|
||||
|
||||
# If we don't have any expansions or only one and that is the same
|
||||
# as the original string, we let other completers run.
|
||||
|
@ -322,7 +322,7 @@ for prepath in "$prepaths[@]"; do
|
||||
else
|
||||
compfiles -p$cfopt tmp1 accex "$skipped" "$_matcher" '' fake "$pats[@]"
|
||||
fi
|
||||
tmp1=( $~tmp1 )
|
||||
eval 'tmp1=( $~tmp1 )' 2>/dev/null
|
||||
|
||||
if [[ -n "$PREFIX$SUFFIX" ]]; then
|
||||
# See which of them match what's on the line.
|
||||
|
Loading…
Reference in New Issue
Block a user