From e937ae5d376b03e89f8ade6e6c015979f59fa363 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Tue, 27 Nov 2007 15:33:06 -0800 Subject: don't expand empty command line --- etc/bash_completion.d/20vyatta-cfg | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'etc') diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index 14a09e8..fe64f40 100644 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -631,8 +631,11 @@ ENDCOMMENT COMPREPLY=( "" " " ) else local -a f_comps=() - get_prefix_filtered_list "${COMP_WORDS[COMP_CWORD]}" \ - vyatta_completions f_comps + local cword= + if (( ${#COMP_WORDS[@]} > 0 )); then + cword=${COMP_WORDS[COMP_CWORD]} + fi + get_prefix_filtered_list "$cword" vyatta_completions f_comps local estr="COMPREPLY=( " for w in "${f_comps[@]}"; do estr="$estr\"$w\" " -- cgit v1.2.3