From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7623 invoked from network); 16 Apr 2002 07:51:32 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 16 Apr 2002 07:51:32 -0000 Received: (qmail 1529 invoked by alias); 16 Apr 2002 07:51:24 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16990 Received: (qmail 1512 invoked from network); 16 Apr 2002 07:51:23 -0000 From: Sven Wischnowsky MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15547.55240.210720.557459@wischnow.berkom.de> Date: Tue, 16 Apr 2002 09:50:32 +0200 To: zsh-workers@sunsite.dk Subject: Re: tab comlpetion bug In-Reply-To: References: <20020412162344.A2049@foozle.jmd> X-Mailer: VM 6.95 under 21.5 (patch 3) "asparagus" XEmacs Lucid Bart Schaefer wrote: > On Fri, 12 Apr 2002, Jeremy M. Dolan wrote: > > > % cd "aaa\! <-- what zsh changes it to > > *hit tab again* > > > > No matches found. It works ok if I don't put the " at the begining. > > It works if you "setopt no_bang_hist", or if you use single quotes (but > note that if you're using the new completion system it won't work exactly > as you have it there, because the argument to "cd" must be a directory). > > The problem is that inside the completion system zsh doesn't know that the > backslash in front of the exclamation point is there solely for the > purpose of preventing a history expansion. So it is trying to complete > files whose names contain a literal backslash-bang. I think the real bug was that the lexer code and get_comp_string() still treated bangs in double quotes specially, even though history expansion was already tried. Since this the non-special treatment *is* special to the completion code the patch below make get_comp_string() treat backslashed bangs in double quotes specially. Bye Sven Index: Src/Zle/zle_tricky.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v retrieving revision 1.35 diff -u -r1.35 zle_tricky.c --- Src/Zle/zle_tricky.c 13 Mar 2002 09:28:05 -0000 1.35 +++ Src/Zle/zle_tricky.c 16 Apr 2002 07:51:09 -0000 @@ -1404,6 +1404,12 @@ qisuf = n; } autoq = ztrdup(q); + + if (instring == 2) { + for (q = s; *q; q++) + if (*q == '\\' && q[1] == '!') + *q = Bnull; + } } /* While building the quoted form, we also clean up the command line. */ for (p = s, tt = qword, i = wb, j = 0; *p; p++, tt++, i++) -- Sven Wischnowsky wischnow@berkom.de