zsh-workers
 help / color / mirror / code / Atom feed
From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: configure --with- completion
Date: Thu, 22 Oct 2015 16:51:54 +0900	[thread overview]
Message-ID: <366A2B9F-701B-4E6E-806C-3F69CBF99D8B@kba.biglobe.ne.jp> (raw)
In-Reply-To: <B63BC678-98DD-4BDF-9C77-6EB2FA21C290@kba.biglobe.ne.jp>


On 2015/10/22, at 1:11, Jun T. <takimoto-j@kba.biglobe.ne.jp> wrote:
> 
> But this patch has effect only with '_arguments --', and does not fix
> the example above (-x and -xy). Patching computil.c would be better ...

So this is a minimal patch I can think of.
Is this reasonable?

diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index e5db086..b664f30 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -1693,10 +1693,13 @@ ca_get_opt(Cadef d, char *line, int full, char **end)
 	for (p = d->opts; p; p = p->next)
 	    if (p->active && ((!p->args || p->type == CAO_NEXT) ?
 			      !strcmp(p->name, line) : strpfx(p->name, line))) {
+		int l = strlen(p->name);
+		if ((p->type == CAO_OEQUAL || p->type == CAO_EQUAL) &&
+		    line[l] && line[l] != '=')
+		    continue;
+
 		if (end) {
 		    /* Return a pointer to the end of the option. */
-		    int l = strlen(p->name);
-
 		    if ((p->type == CAO_OEQUAL || p->type == CAO_EQUAL) &&
 			line[l] == '=')
 			l++;




  reply	other threads:[~2015-10-22  9:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150904084027.GA15509@zira.vinc17.org>
2015-10-20 13:00 ` Vincent Lefevre
2015-10-21 16:11   ` Jun T.
2015-10-22  7:51     ` Jun T. [this message]
2015-10-24 17:00       ` Peter Stephenson

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=366A2B9F-701B-4E6E-806C-3F69CBF99D8B@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --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).