From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29859 invoked from network); 14 Oct 1999 06:43:26 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Oct 1999 06:43:26 -0000 Received: (qmail 18970 invoked by alias); 14 Oct 1999 06:43:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8244 Received: (qmail 18963 invoked from network); 14 Oct 1999 06:43:21 -0000 Date: Thu, 14 Oct 1999 08:43:19 +0200 (MET DST) Message-Id: <199910140643.IAA13840@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Wed, 13 Oct 1999 16:09:00 +0000 Subject: Re: PATCH: _urls, _netscape, a seg fault and new completion thoughts Bart Schaefer wrote: > Doesn't work for me either; not even the first bit that works for Oliver. > I get a listing if I ask for one with ^D, but not with TAB, and automenu > does not work if there's a quote on the line. See: > > ... > > Doesn't matter if the command is ls, cd, bindkey ... unambiguous prefixes > get inserted, but as soon as there's an ambiguity it all stops. Ah, I didn't understand Oliver, sorry. The problem was that in d_ambiguous() we test if the line changed or not to decide if LIST_AMBIGUOUS should be used. But with a quote on the original line, that quote was intermediately removed, but cline_str() inserted the final string, so the comparison failed and it thought it should use LIST_AMBIGUOUS (i.e. don't do anything further in that part of the code). Bye Sven diff -u oldsrc/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- oldsrc/Zle/zle_tricky.c Wed Oct 13 16:17:37 1999 +++ Src/Zle/zle_tricky.c Thu Oct 14 08:37:51 1999 @@ -66,7 +66,7 @@ /* The line before completion was tried. */ static char *origline; -static int origcs; +static int origcs, origll; /* wb and we hold the beginning/end position of the word we are completing. */ @@ -936,6 +936,7 @@ ocs = cs; origline = dupstring((char *) line); origcs = cs; + origll = ll; if (!isfirstln && chline != NULL) { /* If we are completing in a multi-line buffer (which was not * * taken from the history), we have to prepend the stuff saved * @@ -8272,15 +8273,11 @@ * completion options. */ do_ambig_menu(); } else if (ainfo) { - int atend = (cs == we), oll = ll, la, eq, tcs; - VARARR(char, oline, ll); + int atend = (cs == we), la, eq, tcs; minfo.cur = NULL; minfo.asked = 0; - /* Copy the line buffer to be able to easily test if it changed. */ - memcpy(oline, line, ll); - fixsuffix(); /* First remove the old string from the line. */ @@ -8299,7 +8296,7 @@ /* la is non-zero if listambiguous may be used. Copying and * comparing the line looks like BFI but it is the easiest * solution. Really. */ - la = (ll != oll || strncmp(oline, (char *) line, ll)); + la = (ll != origll || strncmp(origline, (char *) line, ll)); /* If REC_EXACT and AUTO_MENU are set and what we inserted is an * * exact match, we want menu completion the next time round * -- Sven Wischnowsky wischnow@informatik.hu-berlin.de