From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9323 invoked from network); 8 Jun 1999 07:40:21 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Jun 1999 07:40:21 -0000 Received: (qmail 8666 invoked by alias); 8 Jun 1999 07:39:52 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6515 Received: (qmail 8647 invoked from network); 8 Jun 1999 07:39:49 -0000 Date: Tue, 8 Jun 1999 08:58:02 +0200 (MET DST) Message-Id: <199906080658.IAA08430@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Mon, 07 Jun 1999 17:21:21 +0200 Subject: Re: Bug in completion with menucomplete and no insertion Peter Stephenson wrote: > Presumably something nasty is happening to memory somewhere before that > point. I checked and it's not even specific to -s: other mistakes in the > get_compctl() called from bin_compgen() do the same thing. The common > factor seems to be that none of the commands produce matches or insert > anything. It seems to need menucomplete set as well; I've reproduced it > after zsh -f, compinit, setopt nobeep menucomplete (nobeep is only > necessary for sanity). Right. For the quote-code I had to add to restore the command line when no completion could be generated (because get_comp_string() removes the quote from the line and changing that would have changed all command line positions held by the completion code). It had planned to look at this again and then forgot to do so. > By the way, I've applied the following trivial patch to zle_tricky.c > for shared-library purposes. Oh no... I'm sorry. Bye Sven diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Mon Jun 7 13:00:08 1999 +++ Src/Zle/zle_tricky.c Tue Jun 8 08:51:11 1999 @@ -66,7 +66,7 @@ /* The line before completion was tried. */ static char *origline; -static int origll, origcs; +static int origcs; /* wb and we hold the beginning/end position of the word we are completing. */ @@ -864,7 +864,6 @@ /* Get the word to complete. */ noerrs = 1; origline = dupstring((char *) line); - origll = ll; origcs = cs; s = get_comp_string(); DPUTS(wb < 0 || cs < wb || cs > we, @@ -4337,9 +4336,9 @@ /* Make sure we have the completion list and compctl. */ if (makecomplist(s, incmd, lst)) { /* Error condition: feeeeeeeeeeeeep(). */ - zsfree((char *) line); - line = (unsigned char *) ztrdup(origline); - ll = origll; + cs = 0; + foredel(ll); + inststr(origline); cs = origcs; feep(); clearlist = 1; -- Sven Wischnowsky wischnow@informatik.hu-berlin.de