zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk, 278368-forwarded@bugs.debian.org
Subject: Re: [vincent@vinc17.org: Bug#278368: zsh-beta: svn completions no longer work]
Date: Tue, 26 Oct 2004 18:04:42 +0100	[thread overview]
Message-ID: <200410261704.i9QH4h5u007735@news01.csr.com> (raw)
In-Reply-To: <20041026144833.GA32520@scowler.net>

Clint Adams wrote:
> When I do a completion like "svn st [TAB]" in a working copy, I get
> the following error message:
> 
> _arguments:comparguments:208: invalid argument: display

This is another collision between the glob code and the pattern match
code as amended.  I think this fixes it.  That file in glob.c really
needs the unmetafy treatment, too.

Index: Src/glob.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/glob.c,v
retrieving revision 1.36
diff -u -r1.36 glob.c
--- Src/glob.c	18 Oct 2004 11:56:17 -0000	1.36
+++ Src/glob.c	26 Oct 2004 17:02:55 -0000
@@ -2206,8 +2206,20 @@
     repllist = NULL;
 
     /* perform must-match test for complex closures */
-    if (p->mustoff && !strstr((char *)s, (char *)p + p->mustoff))
-	matched = 0;
+    if (p->mustoff)
+    {
+	/*
+	 * Yuk.  Probably we should rewrite this whole function to
+	 * use an unmetafied test string.
+	 *
+	 * Use META_HEAPDUP because we need a terminating NULL.
+	 */
+	char *muststr = metafy((char *)p + p->mustoff,
+			       p->patmlen, META_HEAPDUP);
+
+	if (!strstr(s, muststr))
+	    matched = 0;
+    }
 
     /* in case we used the prog before... */
     p->flags &= ~(PAT_NOTSTART|PAT_NOTEND);
Index: Test/D02glob.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/D02glob.ztst,v
retrieving revision 1.7
diff -u -r1.7 D02glob.ztst
--- Test/D02glob.ztst	22 Oct 2004 15:36:40 -0000	1.7
+++ Test/D02glob.ztst	26 Oct 2004 17:02:56 -0000
@@ -312,3 +312,8 @@
  [[ "" = "" ]] && echo OK
 0:Empty strings
 >OK
+
+ foo="this string has a : colon in it"
+ print ${foo%% #:*}
+0:Must-match arguments in complex patterns
+>this string has a

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


      reply	other threads:[~2004-10-26 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-26 14:48 Clint Adams
2004-10-26 17:04 ` Peter Stephenson [this message]

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=200410261704.i9QH4h5u007735@news01.csr.com \
    --to=pws@csr.com \
    --cc=278368-forwarded@bugs.debian.org \
    --cc=zsh-workers@sunsite.dk \
    /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).