From 3e64861ebf343874ac0d89167e477d012f3006b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 4 May 2022 11:22:12 +0300 Subject: [PATCH] fix(bash-v2): skip empty completions when filtering descriptions `read` gives a last null value following a trailing newline. Regression from fb8031162c2ffab270774f13c6904bb04cbba5a7. --- bash_completionsV2.go | 1 + 1 file changed, 1 insertion(+) diff --git a/bash_completionsV2.go b/bash_completionsV2.go index a06ab456c..a74c4192c 100644 --- a/bash_completionsV2.go +++ b/bash_completionsV2.go @@ -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