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/2) with ESMTP id XAA17742 for ; Thu, 20 Jun 1996 23:11:54 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id IAA07735; Thu, 20 Jun 1996 08:59:42 -0400 (EDT) Resent-Date: Thu, 20 Jun 1996 08:59:42 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199606201259.OAA14383@bolyai.cs.elte.hu> Subject: Re: compclt-problem in beta21 To: sverre@iki.fi Date: Thu, 20 Jun 1996 14:59:03 +0200 (MET DST) Cc: zsh-workers@math.gatech.edu In-Reply-To: <199606201032.NAA04210@nike.spices> from Sverre Slotte at "Jun 20, 96 01:32:32 pm" Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368 X-Mailer: ELM [version 2.4ME+ PL16 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"vf-uf2.0.nu1.ziKon"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1376 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > Hi, > > I have this compctl-line in my .zshrc: > > compctl -x 's[+] c[-1,-f],s[-f+]' -g '~/Mail/*(:t)' \ > - 's[-f],c[-1,-f]' -f -- elm > > (virtually the same as in the man-page) > > This used to work fine up to beta17 (my latest version), but it does > not work with beta21 anymore. Specifically, it does not expand the > files in my ~/Mail directory. I.e: Are you sure it did work in beta17? The problem is that ~ is not a glob character unless extendedglob is set. Also tilde and equals substitution is not part of globbing, and the manual says that -g expands glob patterns. So zsh just behaves as documented. But the source code and the existing practise suggests that this is really a bug. In beta21, tokenize() only tokenizes glob special characters. The patch below should fix that problem by tokenizing leading ~ and =. Zoltan *** Src/zle_tricky.c 1996/06/15 02:20:10 2.50 --- Src/zle_tricky.c 1996/06/20 12:47:50 *************** *** 2673,2678 **** --- 2673,2682 ---- *p = '\0'; /* Get the pattern string. */ tokenize(g = dupstring(g)); + if (*g == '=') + *g = Equals; + if (*g == '~') + *g = Tilde; remnulargs(g); if (*g == Equals || *g == Tilde) { /* The pattern has a `~' or `=' at the *