From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8873 invoked from network); 26 May 1999 06:43:20 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 May 1999 06:43:20 -0000 Received: (qmail 21446 invoked by alias); 26 May 1999 06:43:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6352 Received: (qmail 21439 invoked from network); 26 May 1999 06:43:10 -0000 Date: Wed, 26 May 1999 08:43:08 +0200 (MET DST) Message-Id: <199905260643.IAA07549@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 25 May 1999 03:20:04 +0900 Subject: Re: zsh-3.1.5-pws-19 unquotes prefix. Tanaka Akira wrote: > Z(2):akr@is27e1u11% ./Src/zsh -f > is27e1u11% fpath=($PWD/Completion/*(/)) > is27e1u11% . Completion/Core/compinit > is27e1u11% _tst () { compset -P '\*' && compadd -- a } > is27e1u11% _comps[tst]=_tst > is27e1u11% tst \* > > I get following. > > is27e1u11% tst *a > > I think that zsh sould not unquote *. > > is27e1u11% tst \*a That was one problem. The other was that with old completion and `compctl -P '\*' -k '(a b)' foo', completion after `ls \*' didn't work at all. Again, completion and quoting, sigh. Bye Sven --- os/Zle/zle_tricky.c Fri May 21 23:47:01 1999 +++ Src/Zle/zle_tricky.c Tue May 25 19:40:22 1999 @@ -3596,8 +3596,13 @@ /* Get the contents of the completion variables if we have * to perform matching. */ if (dat->aflags & CAF_MATCH) { - lipre = dupstring(compiprefix); - lisuf = dupstring(compisuffix); + if (dat->aflags & CAF_QUOTE) { + lipre = dupstring(compiprefix); + lisuf = dupstring(compisuffix); + } else { + lipre = quotename(compiprefix, NULL); + lisuf = quotename(compisuffix, NULL); + } lpre = dupstring(compprefix); lsuf = dupstring(compsuffix); llpl = strlen(lpre); @@ -5324,10 +5329,11 @@ int pl = 0; if (*s) { + char *dp = rembslash(cc->prefix); /* First find out how much of the prefix is already on the line. */ sd = dupstring(s); untokenize(sd); - pl = pfxlen(cc->prefix, sd); + pl = pfxlen(dp, sd); s += pl; sd += pl; offs -= pl; @@ -5335,7 +5341,7 @@ } /* Does this compctl have a suffix (compctl -S)? */ if (cc->suffix) { - char *sdup = dupstring(cc->suffix); + char *sdup = rembslash(cc->suffix); int sl = strlen(sdup), suffixll; /* Ignore trailing spaces. */ -- Sven Wischnowsky wischnow@informatik.hu-berlin.de