Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: Bad interaction between -iprefix and -string
- X-seq: zsh-workers 5342
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: Re: Bad interaction between -iprefix and -string
- Date: Thu, 11 Feb 1999 16:41:32 +0100 (MET)
- In-reply-to: Peter Stephenson's message of Thu, 11 Feb 1999 15:12:15 +0100
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Peter Stephenson wrote:
> This came out of my attempts to handle dd, but here's a simpler test.
> The [[ ... ]] stuck on its own looks funny, but it relies on the side
> effect on IPREFIX.
>
> % defcomp stest
> % which __stest
> __stest () {
> if [[ -iprefix name= ]]
> then
> [[ -string , ]]
> complist -k '(yan tan tethera dick)'
> fi
> }
> % stest name=y<TAB> # produces...
> % stest name=yan # OK so far, add `,te' by hand...
> % stest name=yan,te<TAB> # produces...
> % stest name=yan,tedick # The te is being ignored, too.
I forgot to ignore the already ignored prefix for this kind of
condition.
Stuff like the above makes me think that even more control over the
inserted suffixes would be nice. In this case: make a `,' fall in
place automatically.
Bye
Sven
--- os/Zle/compctl.c Tue Feb 9 09:22:04 1999
+++ Src/Zle/compctl.c Thu Feb 11 16:36:41 1999
@@ -2025,7 +2025,7 @@
{
if (comp_check()) {
char *s;
- int i;
+ int i, ipl;
if (a[1]) {
s = cond_str(a, 1);
@@ -2038,9 +2038,9 @@
zerr("zle not loaded, zle condition not available", NULL, 0);
return 1;
}
- i = getcpatptr(comp_strptr(NULL, NULL), i, s, id);
+ i = getcpatptr(comp_strptr(&ipl, NULL), i, s, id);
if (i != -1) {
- ignore_prefix(i);
+ ignore_prefix(i - ipl);
return 1;
}
}
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author