From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16426 invoked from network); 11 Feb 1999 15:43:32 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 11 Feb 1999 15:43:32 -0000 Received: (qmail 28067 invoked by alias); 11 Feb 1999 15:42:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5342 Received: (qmail 28060 invoked from network); 11 Feb 1999 15:42:17 -0000 Date: Thu, 11 Feb 1999 16:41:32 +0100 (MET) Message-Id: <199902111541.QAA06148@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Thu, 11 Feb 1999 15:12:15 +0100 Subject: PATCH: Re: Bad interaction between -iprefix and -string 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 # produces... > % stest name=yan # OK so far, add `,te' by hand... > % stest name=yan,te # 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@informatik.hu-berlin.de