Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _regex_words: Don't add mismatched parentheses
- X-seq: zsh-workers 37215
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] _regex_words: Don't add mismatched parentheses
- Date: Wed, 25 Nov 2015 01:46:55 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=KnDsgtgXw3/uftE0A08IqN1MKBc=; b=mlZsmr lFBEgEtqZH/H90B9mWNbTLTFMRDucSC3D0/zVkkYfPw2mLjkg4RPhB6WYtMoxy4J bN2TwxtBVIkUGsrjWtAGl6DL0OhB4kWCi74vyK8Z4aPAK//m3jPxu9An1eIvnMqq 8/C/IryDZqCHnJuiQaJiv5pQj66QlF0E37coM=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=KnDsgtgXw3/uftE0A08IqN1MKBc=; b=sbutH rvZnAfm67rW/aRmNXzqS4gIfC2AC5klusSiIsf9o8EusNKiOsC/+bvvUydzUpe8l naXU00BlepydffjrHSNRNayHa6S5yiDN3Kr+rA/JLDWVbFSiQrJOE3rFhABuzJWD esW+u/aNln181IcFFmy2i96fFUEZlRkCs3VOLM=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
---
diff --git a/Completion/Base/Utility/_regex_words b/Completion/Base/Utility/_regex_words
index 77ba197..62c2491 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author