_init_completion: Handle cword < 0 (LP: #1289597)

Previously only bash 4.3 seemed to provoke this, but now with the
empty command consistency tweak it occurs with earlier as well.
This commit is contained in:
Barry Warsaw 2014-09-17 19:32:43 +03:00 committed by Ville Skyttä
parent 7394d744ae
commit a9c556ccad

View File

@ -727,7 +727,7 @@ _init_completion()
fi
done
[[ $cword -eq 0 ]] && return 1
[[ $cword -le 0 ]] && return 1
prev=${words[cword-1]}
[[ ${split-} ]] && _split_longopt && split=true