zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: [PATCH] _regex_words: Don't add mismatched parentheses
Date: Wed, 25 Nov 2015 01:46:55 +0000	[thread overview]
Message-ID: <20151125014655.GH1848@tarsus.local2> (raw)

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


                 reply	other threads:[~2015-11-25  1:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151125014655.GH1848@tarsus.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).