- _ssh(): fix newline from making it into compgen -W and consuming all of

system memory
This commit is contained in:
ianmacd 2002-05-11 15:22:12 +00:00
parent 9a93763757
commit cac78e3408

View File

@ -1,6 +1,6 @@
# bash_completion - some programmable completion functions for bash 2.05a # bash_completion - some programmable completion functions for bash 2.05a
# #
# $Id: bash_completion,v 1.311 2002/05/11 09:28:58 ianmacd Exp $ # $Id: bash_completion,v 1.312 2002/05/11 17:22:12 ianmacd Exp $
# #
# Copyright (C) Ian Macdonald <ian@caliban.org> # Copyright (C) Ian Macdonald <ian@caliban.org>
# #
@ -1668,7 +1668,7 @@ _ssh()
# get host aliases from config files # get host aliases from config files
if [ ${#config[@]} -gt 0 ]; then if [ ${#config[@]} -gt 0 ]; then
hosts=$( compgen -W "$( sed -ne "s/^Host["$'\t '"]*\([^*?]*\)$/\1/p" ${config[@]} )" -- $cur) hosts=$( compgen -W "$( echo $( sed -ne "s/^Host["$'\t '"]*\([^*?]*\)$/\1/p" ${config[@]} ) )" -- $cur )
COMPREPLY=( ${COMPREPLY[@]} $hosts ) COMPREPLY=( ${COMPREPLY[@]} $hosts )
fi fi