From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3) with ESMTP id KAA12204 for ; Thu, 23 May 1996 10:50:39 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id UAA01174; Wed, 22 May 1996 20:34:33 -0400 (EDT) Resent-Date: Wed, 22 May 1996 20:34:33 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199605230034.CAA03589@hzoli.ppp.cs.elte.hu> Subject: Re: compctl bug in 2.6-betat17 To: alainc@nortel.ca Date: Thu, 23 May 1996 02:34:06 +0200 (MET DST) Cc: zsh-workers@math.gatech.edu (Zsh hacking and development) In-Reply-To: from "hzoli@cs.elte.hu" at "May 22, 96 01:48:56 am" X-Mailer: ELM [version 2.4ME+ PL11 (25)] MIME-Version: 1.0 Content-Type: application/pgp; format=text; x-action=sign Content-Transfer-Encoding: 7bit Resent-Message-ID: <"PwIrX.0.GI.OAxen"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1141 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----BEGIN PGP SIGNED MESSAGE----- Alain (a.) Caron" wrote: > I think I have found a bug in release 2.6-beta17 with regards to > compctl. > > I have the following line in my .zshrc > > # rm Emacs backup and autosave files first > compctl -g "*\~(D) \#*\#(D)" + -f rm > FIGNORE=".o:~" > > which allows me to complete to an EMACS backup or autosave file when > removing files but to ignore backup files for other commands. > > With zsh 2.5.03, it works as expected, but not with 2.6-beta17. For Here is a patch for that. Zoltan *** Src/glob.c 1996/05/22 21:00:06 2.14 --- Src/glob.c 1996/05/22 23:29:36 *************** *** 1106,1112 **** int val, len; char *b2; - remnulargs(b); len = strlen(b); b2 = (char *)alloc(len + 3); strcpy(b2 + 1, b); --- 1106,1111 ---- *************** *** 1221,1227 **** char *s = *sp, *t, sav; int i, j, l = strlen(*sp); - remnulargs(pat); c = parsereg(pat); if (!c) { zerr("bad pattern: %s", pat, 0); --- 1220,1225 ---- *************** *** 1803,1808 **** --- 1801,1807 ---- Comp parsereg(char *str) { + remnulargs(str); mode = 1; /* no path components */ pptr = str; return parsecompsw(0); *** Src/zle_tricky.c 1996/05/20 00:06:13 2.35 --- Src/zle_tricky.c 1996/05/22 23:30:08 *************** *** 2075,2080 **** --- 2075,2081 ---- p[tl + 1] = '\0'; } /* Do the globbing... */ + remnulargs(p); addlinknode(l, p); globlist(l); /* And see if that produced a filename. */ *************** *** 2574,2579 **** --- 2575,2581 ---- /* Do the globbing. */ tokenize(p); + remnulargs(p); addlinknode(l, p); globlist(l); *************** *** 2654,2659 **** --- 2656,2662 ---- *p = '\0'; /* Get the pattern string. */ tokenize(g = dupstring(g)); + remnulargs(g); if (*g == Equals || *g == Tilde) { /* The pattern has a `~' or `=' at the * * beginning, so we expand this and use * *************** *** 2665,2672 **** * with '/'), so add it unchanged. */ addlinknode(l, dupstring(g)); else { ! /* It's a simple patter, so append it to * ! * the path we have on the command line. */ strcpy(pa + o, g); addlinknode(l, dupstring(pa)); } --- 2668,2675 ---- * with '/'), so add it unchanged. */ addlinknode(l, dupstring(g)); else { ! /* It's a simple pattern, so append it to * ! * the path we have on the command line. */ strcpy(pa + o, g); addlinknode(l, dupstring(pa)); } -----BEGIN PGP SIGNATURE----- Version: 2.6.3i Charset: noconv iQCVAwUBMaOyfAupSCiLN749AQEffgP/SNnHuPV8NU1JHU22moEGYXjUjse/EMU+ GvWg2Byn8VXOhcPuKc4tUR4oATTZEbX7km6rZjYs2LAAzaLut7WRFOR5+v7qrVOd iTvSIWa+Mxjp1qtOIBP7oB4Nu1INTiJtHzNeJlAJz5+yK9A/xTfqDItvabuf17LH NX5UsmR5g/s= =EDcK -----END PGP SIGNATURE-----