From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21916 invoked from network); 9 Sep 2009 04:33:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 9 Sep 2009 04:33:21 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 30723 invoked from network); 9 Sep 2009 04:33:14 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Sep 2009 04:33:14 -0000 Received: (qmail 3470 invoked by alias); 9 Sep 2009 04:33:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27254 Received: (qmail 3439 invoked from network); 9 Sep 2009 04:33:08 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 9 Sep 2009 04:33:08 -0000 Received: from QMTA12.westchester.pa.mail.comcast.net (qmta12.westchester.pa.mail.comcast.net [76.96.59.227]) by bifrost.dotsrc.org (Postfix) with ESMTP id 0AD25801E2BF for ; Wed, 9 Sep 2009 06:32:49 +0200 (CEST) Received: from OMTA24.westchester.pa.mail.comcast.net ([76.96.62.76]) by QMTA12.westchester.pa.mail.comcast.net with comcast id eU3L1c0091ei1Bg5CUYqMg; Wed, 09 Sep 2009 04:32:50 +0000 Received: from smtp.klanderman.net ([98.217.254.247]) by OMTA24.westchester.pa.mail.comcast.net with comcast id eUdZ1c0025M2Np63kUdZdM; Wed, 09 Sep 2009 04:37:33 +0000 Received: from lwm.klanderman.net (unknown [192.168.100.50]) by smtp.klanderman.net (Postfix) with ESMTP id CB2C2B3015C; Wed, 9 Sep 2009 00:32:48 -0400 (EDT) Received: by lwm.klanderman.net (Postfix, from userid 500) id AC5EE9FC5F3; Wed, 9 Sep 2009 00:32:48 -0400 (EDT) From: Greg Klanderman To: zsh-workers@sunsite.dk Subject: Re: file completion of ~user/... stats wrong directory Reply-To: gak@klanderman.net Date: Wed, 09 Sep 2009 00:32:48 -0400 In-Reply-To: <200907101421.n6AELWFS028008@news01.csr.com> (Peter Stephenson's message of "Fri, 10 Jul 2009 15:21:32 +0100") Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.17 (linux) References: <19030.11925.370937.608524@gargle.gargle.HOWL> <20090710100721.56b0874c@news01> <200907101421.n6AELWFS028008@news01.csr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.94.2/9786/Wed Sep 9 04:58:04 2009 on bifrost X-Virus-Status: Clean >>>>> On July 10, 2009 Peter Stephenson wrote: > Certainly sounds plausible. It's odd this isn't an ever worse problem, > but _path_files has so many possibilities it's surprisingly hard to > trigger particular problems. Looks like this is being caused by the 'accept-exact-dirs' logic in _path_files: | if zstyle -t ":completion:${curcontext}:paths" accept-exact-dirs && | [[ $pre = (#b)(*)/([^/]#) ]]; then | # We've been told that we can accept an exact directory | # prefix immediately. Try this with the longest path prefix | # first: this saves stats in the simple case and may get around | # automount behaviour if early components don't yet exist. | tmp1=$match[1] | tpre=$match[2] | while true; do | if [[ -d $donepath$tmp1 ]]; then | donepath=$donepath$tmp1/ | pre=$tpre | break | elif [[ $tmp1 = (#b)(*)/([^/]#) ]]; then | tmp1=$match[1] | tpre=$match[2]/$tpre | else | break | fi | done | fi When completing something of the form ~user/foo or $bar/foo, the test [[ -d $donepath$tmp1 ]] is stat'ing the path 'foo' relative to the current directory rather than with the stripped off prefix re-added. greg