From 2ab41d508d453be2305b898325a9a87f00aaebda Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 25 Nov 2015 01:46:55 +0000 Subject: 37215: _regex_words: Don't add mismatched parentheses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I ran into this in the wild¹, it manifested as the following error message: zregexparse:4: not enough regex arguments ¹ https://bug.tasktools.org/browse/TW-1729 --- Completion/Base/Utility/_regex_words | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Completion/Base') diff --git a/Completion/Base/Utility/_regex_words b/Completion/Base/Utility/_regex_words index 77ba197a4..62c2491bb 100644 --- a/Completion/Base/Utility/_regex_words +++ b/Completion/Base/Utility/_regex_words @@ -20,7 +20,13 @@ local tag=$1 local desc=$2 shift 2 -reply=(\() +if (( $# )); then + reply=(\() +else + # ### Is this likely to happen in callers? Should we warn? + reply=() + return +fi integer i local -a wds -- cgit 1.4.1