From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11708 invoked from network); 28 Aug 2000 07:14:03 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Aug 2000 07:14:03 -0000 Received: (qmail 27949 invoked by alias); 28 Aug 2000 07:13:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12711 Received: (qmail 27942 invoked from network); 28 Aug 2000 07:13:27 -0000 Date: Mon, 28 Aug 2000 09:13:23 +0200 (MET DST) Message-Id: <200008280713.JAA15326@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Mon, 28 Aug 2000 10:33:34 +0400 Subject: Re: Problem with _cd return code Andrej Borsenkow wrote: > ... when completing directory stack (cd -TAB). It completes it alright, but it > always beeps; and sometimes I get additionally external directories listed. > > It looks like return code problem, but I could not figure out how to fix it. I > do not quite understand, what _wanted, _requested etc are supposed to return. The same as all completion functions, of course: zero if matches were added, non-zero otherwise. What's happening is quite easy to see in _cd. That calls _popd for the directory stack like this: elif _popd || [[ $PREFIX != (\~|/|./|../)* && $#cdpath -ne 0 ]]; then So, if _popd succeeds (adds matches), we go on completing, forgetting about the zero-return from _popd and instead using the return value of one of the calls to _wanted or the return value from _alternative as the result of _cd. We should probably change that to something like: else _popd && ret=0 if [[ $PREFIX != (\~|/|./|../)* && $#cdpath -ne 0 ]]; then ... else ... fi return ret fi Unless I'm missing something that was intended by whoever wrote that. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de