Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: compclt-problem in beta21
- X-seq: zsh-workers 1376
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: sverre@xxxxxx
- Subject: Re: compclt-problem in beta21
- Date: Thu, 20 Jun 1996 14:59:03 +0200 (MET DST)
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <199606201032.NAA04210@xxxxxxxxxxx> 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
> 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 *
Messages sorted by:
Reverse Date,
Date,
Thread,
Author