From f6c4e87af284c9208b0f1fc6e86a773113a0463f Mon Sep 17 00:00:00 2001 From: tsi Date: Sat, 3 Jan 2026 01:25:09 +0100 Subject: [PATCH] Make is_first_word_prefix regex a global var if bash-abbr is sourced in a function --- bash-abbr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash-abbr b/bash-abbr index 1056501..423f7eb 100644 --- a/bash-abbr +++ b/bash-abbr @@ -179,7 +179,7 @@ _redir_or_assign_word () { # shellcheck disable=SC2155 declare _redir_or_assign_word="$(_redir_or_assign_word)" # TODO use bash 5.3 `${}` command substitution syntax to avoid subshells -declare -r is_first_word_prefix="($_control_op)[[:blank:]]*((($_redir_or_assign_word)[[:blank:]])*)" +declare -gr is_first_word_prefix="($_control_op)[[:blank:]]*((($_redir_or_assign_word)[[:blank:]]+)*)" # If the regex leads to problems/performance issues, you may try this simpler regex # that does no redirection/assignment word checking: # declare -r is_first_word_prefix="($_control_op)[[:blank:]]*"