From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1636 invoked from network); 5 Nov 1998 13:31:43 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 5 Nov 1998 13:31:43 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id IAA25010; Thu, 5 Nov 1998 08:23:43 -0500 (EST) Resent-Date: Thu, 5 Nov 1998 08:23:43 -0500 (EST) Date: Thu, 5 Nov 1998 14:21:40 +0100 (MET) Message-Id: <199811051321.OAA03361@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@math.gatech.edu In-reply-to: Peter Stephenson's message of Thu, 05 Nov 1998 13:44:27 +0100 Subject: Re: PATCH: Re: Two more (possible) problems with the new completion... Resent-Message-ID: <"MfB8z3.0.g66.VRQGs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4558 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Peter Stephenson wrote: > > Sven Wischnowsky wrote: > > `-W' behaves like `-k', you only need `compctl -W cdpath -/ cd'. There > > is some extra hacklet that ensures that the old style (giving one > > directory) still works (in most cases): if the string isn't an > > parameter name, it is used directly as a directory name. So, unless > > you have a directory named `$cdpath' (*not* the value of `cdpath') it > > will produce no matches. > > Fine, but ... :-) > > In this case the return value of get_user_var() is a pointer to the > stored array itself, so the array shouldn't be modified. The present > code does a mischief to the value of $cdpath after the completion is > finished. The patch below fixes it (I can even do this one myself). Thanks. The patch below goes on top of this, just to keep gcc quiet. BTW, in the Peter's glob patch he added some braces to keep gcc from emitting lots of `ambiguous else' warnings and I've similiar things in zle_tricky.c. We should remember to fix all of these (and the `char used as subscript' warnings) before the next official release. all th Bye Sven *** os/Zle/zle_tricky.c Thu Nov 5 14:17:03 1998 --- Src/Zle/zle_tricky.c Thu Nov 5 14:17:08 1998 *************** *** 3848,3854 **** if ((pp = get_user_var(cc->withd))) { dirs = npp = ! (char*) halloc(sizeof(char *)*(arrlen(pp)+1)); while (*pp) { pl = strlen(*pp); tp = (char *) halloc(strlen(*pp) + tl); --- 3848,3854 ---- if ((pp = get_user_var(cc->withd))) { dirs = npp = ! (char**) halloc(sizeof(char *)*(arrlen(pp)+1)); while (*pp) { pl = strlen(*pp); tp = (char *) halloc(strlen(*pp) + tl); -- Sven Wischnowsky wischnow@informatik.hu-berlin.de