fix(bash-v2): skip empty completions when filtering descriptions (#1691)

`read` gives a last null value following a trailing newline.

Regression from fb8031162c.
This commit is contained in:
Ville Skyttä 2022-05-17 20:47:47 +03:00 committed by GitHub
parent 8afe9d1b56
commit e1ded5cd94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,6 +188,7 @@ __%[1]s_handle_standard_completion_case() {
local compline
# Look for the longest completion so that we can format things nicely
while IFS='' read -r compline; do
[[ -z $compline ]] && continue
# Strip any description before checking the length
comp=${compline%%%%$tab*}
# Only consider the completions that match