mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-05 11:01:13 +02:00
users/17051: explicit IFS for "read" in compinit
This commit is contained in:
parent
c5c3cd9af1
commit
3d75ca5c64
2 changed files with 11 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2012-07-17 Barton E. Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* users/17051 (cf. 30571): Completion/compinit: explicit IFS for
|
||||||
|
"read" of bindkey, dumpfiles, etc.
|
||||||
|
|
||||||
2012-07-15 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
2012-07-15 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
* Bart: 30560: Src/builtin.c: unset array element by setting
|
* Bart: 30560: Src/builtin.c: unset array element by setting
|
||||||
|
@ -16447,5 +16452,5 @@
|
||||||
|
|
||||||
*****************************************************
|
*****************************************************
|
||||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||||
* $Revision: 1.5679 $
|
* $Revision: 1.5680 $
|
||||||
*****************************************************
|
*****************************************************
|
||||||
|
|
|
@ -326,7 +326,7 @@ compdef() {
|
||||||
[[ $2 = .menu-select ]] && zmodload -i zsh/complist
|
[[ $2 = .menu-select ]] && zmodload -i zsh/complist
|
||||||
zle -C "$1" "$2" "$func"
|
zle -C "$1" "$2" "$func"
|
||||||
if [[ -n $new ]]; then
|
if [[ -n $new ]]; then
|
||||||
bindkey "$3" | read -A opt
|
bindkey "$3" | IFS=$' \t' read -A opt
|
||||||
[[ $opt[-1] = undefined-key ]] && bindkey "$3" "$1"
|
[[ $opt[-1] = undefined-key ]] && bindkey "$3" "$1"
|
||||||
else
|
else
|
||||||
bindkey "$3" "$1"
|
bindkey "$3" "$1"
|
||||||
|
@ -353,7 +353,7 @@ compdef() {
|
||||||
# And bind the keys...
|
# And bind the keys...
|
||||||
for i; do
|
for i; do
|
||||||
if [[ -n $new ]]; then
|
if [[ -n $new ]]; then
|
||||||
bindkey "$i" | read -A opt
|
bindkey "$i" | IFS=$' \t' read -A opt
|
||||||
[[ $opt[-1] = undefined-key ]] || continue
|
[[ $opt[-1] = undefined-key ]] || continue
|
||||||
fi
|
fi
|
||||||
bindkey "$i" "$func"
|
bindkey "$i" "$func"
|
||||||
|
@ -469,7 +469,7 @@ _i_done=''
|
||||||
|
|
||||||
if [[ -f "$_comp_dumpfile" ]]; then
|
if [[ -f "$_comp_dumpfile" ]]; then
|
||||||
if [[ -n "$_i_check" ]]; then
|
if [[ -n "$_i_check" ]]; then
|
||||||
read -rA _i_line < "$_comp_dumpfile"
|
IFS=$' \t' read -rA _i_line < "$_comp_dumpfile"
|
||||||
if [[ _i_autodump -eq 1 && $_i_line[2] -eq $#_i_files &&
|
if [[ _i_autodump -eq 1 && $_i_line[2] -eq $#_i_files &&
|
||||||
$ZSH_VERSION = $_i_line[4] ]]
|
$ZSH_VERSION = $_i_line[4] ]]
|
||||||
then
|
then
|
||||||
|
@ -491,7 +491,7 @@ if [[ -z "$_i_done" ]]; then
|
||||||
_i_name="${_i_file:t}"
|
_i_name="${_i_file:t}"
|
||||||
(( $+_i_test[$_i_name] + $_i_wfiles[(I)$_i_file] )) && continue
|
(( $+_i_test[$_i_name] + $_i_wfiles[(I)$_i_file] )) && continue
|
||||||
_i_test[$_i_name]=yes
|
_i_test[$_i_name]=yes
|
||||||
read -rA _i_line < $_i_file
|
IFS=$' \t' read -rA _i_line < $_i_file
|
||||||
_i_tag=$_i_line[1]
|
_i_tag=$_i_line[1]
|
||||||
shift _i_line
|
shift _i_line
|
||||||
case $_i_tag in
|
case $_i_tag in
|
||||||
|
@ -527,7 +527,7 @@ zle -la menu-select && zle -C menu-select .menu-select _main_complete
|
||||||
|
|
||||||
# If the default completer set includes _expand, and tab is bound
|
# If the default completer set includes _expand, and tab is bound
|
||||||
# to expand-or-complete, rebind it to complete-word instead.
|
# to expand-or-complete, rebind it to complete-word instead.
|
||||||
bindkey '^i' | read -A _i_line
|
bindkey '^i' | IFS=$' \t' read -A _i_line
|
||||||
if [[ ${_i_line[2]} = expand-or-complete ]] &&
|
if [[ ${_i_line[2]} = expand-or-complete ]] &&
|
||||||
zstyle -a ':completion:' completer _i_line &&
|
zstyle -a ':completion:' completer _i_line &&
|
||||||
(( ${_i_line[(i)_expand]} <= ${#_i_line} )); then
|
(( ${_i_line[(i)_expand]} <= ${#_i_line} )); then
|
||||||
|
|
Loading…
Reference in a new issue