zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Danek Duvall <duvall@emufarm.org>
Cc: Zsh Workers <zsh-workers@sunsite.dk>
Subject: PATCH: Re: completion in braces
Date: Thu, 07 Nov 2002 16:43:36 +0000	[thread overview]
Message-ID: <E189pkm-0006C2-00@bimbo.logica.co.uk> (raw)
In-Reply-To: <20021008045836.GA28326@aeolian.emufarm.org>

On 7 Oct, Danek Duvall wrote:
> Completion inside braces of filenames containing commas leaves the
> filenames improperly escaped:
> 
> % ls
> a,a  a,b  a,c  b,a  b,b  b,c
> % ls -l $PWD/{			Hit tab =>
> % ls -l $PWD/{a,a		Type comma/tab/tab =>

Following patch seems to fix this, at least for the new completion
system. But I'm no expert on what's going on in the completion code so
I'd be happier if someone else such as Sven could check this and perhaps
get it to work for the compctl system too.

Oliver

Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.83
diff -u -r1.83 computil.c
--- Src/Zle/computil.c	27 Aug 2002 21:10:34 -0000	1.83
+++ Src/Zle/computil.c	7 Nov 2002 16:29:53 -0000
@@ -3345,6 +3345,20 @@
     if (x)
 	*str = *ret = '=';
 
+    /* quote commas inside brace expansions */
+    if (brbeg) {
+	char *u = ret;
+	char *v;
+
+	v = ret = hcalloc(2 * strlen(u) + 1);
+	while (*u) {
+            if (*u == ',')
+        	*v++ = '\\';
+            *v++ = *u++;
+	}
+	*v = '\0';
+    }
+
     return ret;
 }
 

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.


  reply	other threads:[~2002-11-07 16:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-08  4:58 Danek Duvall
2002-11-07 16:43 ` Oliver Kiddle [this message]
2002-11-11  9:03   ` PATCH: " Sven Wischnowsky

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=E189pkm-0006C2-00@bimbo.logica.co.uk \
    --to=okiddle@yahoo.co.uk \
    --cc=duvall@emufarm.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).