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
1 changed files with 1 additions and 0 deletions

View File

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