From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22737 invoked from network); 26 Mar 2008 15:37:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Mar 2008 15:37:00 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 4139 invoked from network); 26 Mar 2008 15:36:56 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Mar 2008 15:36:56 -0000 Received: (qmail 4729 invoked by alias); 26 Mar 2008 15:36:52 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24742 Received: (qmail 4715 invoked from network); 26 Mar 2008 15:36:52 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 26 Mar 2008 15:36:52 -0000 Received: from vms048pub.verizon.net (vms048pub.verizon.net [206.46.252.48]) by bifrost.dotsrc.org (Postfix) with ESMTP id 7A44B8097826 for ; Wed, 26 Mar 2008 16:36:42 +0100 (CET) Received: from torch.brasslantern.com ([71.116.79.77]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JYC00MVAGP4SHI0@vms048.mailsrvcs.net> for zsh-workers@sunsite.dk; Wed, 26 Mar 2008 10:36:42 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id m2QFacpd016860; Wed, 26 Mar 2008 08:36:39 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id m2QFacNd016859; Wed, 26 Mar 2008 08:36:38 -0700 Date: Wed, 26 Mar 2008 08:36:38 -0700 From: Bart Schaefer Subject: Re: _canonical_path not working on *BSD In-reply-to: <20080326114413.80713vrmznwpnyuc@bapt.selfip.org> To: Baptiste Daroussin , zsh-workers@sunsite.dk Message-id: <080326083638.ZM16858@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20080326114413.80713vrmznwpnyuc@bapt.selfip.org> Comments: In reply to Baptiste Daroussin "_canonical_path not working on *BSD" (Mar 26, 11:44am) X-Virus-Scanned: ClamAV 0.91.2/6396/Wed Mar 26 12:29:12 2008 on bifrost X-Virus-Status: Clean On Mar 26, 11:44am, Baptiste Daroussin wrote: } } _canonical_path is not working on freebsd, it rely on readlink Try this. I don't actually have any mount points that are symlink targets so it's hard to test, but I think this is right: --- ../zsh-forge/current/Completion/Unix/Type/_canonical_paths 2006-05-28 11:36:06.000000000 -0700 +++ ../zsh-4.0/Completion/Unix/Type/_canonical_paths 2008-03-26 08:31:42.000000000 -0700 @@ -27,7 +27,7 @@ shift 2 -if (( ! $+commands[readlink] )); then +if ! zmodload -F zsh/stat b:zstat 2>/dev/null; then _wanted "$tag" expl "$desc" compadd $__gopts $@ && ret=0 return ret fi @@ -38,7 +38,7 @@ files=($@) else for __index in $@; do - files+=$(readlink -qf $__index) + files+=$(zstat +link $__index) done fi @@ -48,8 +48,8 @@ expref=${~origpref} [[ $origpref == (|*/). ]] && rltrim=. curpref=${${expref%$rltrim}:-./} - canpref=$(readlink -qf $curpref) - if [[ $? -eq 0 ]]; then + canpref=$(zstat +link $curpref) + if [[ -n "$canpref" ]]; then [[ $curpref == */ && $canpref == *[^/] ]] && canpref+=/ canpref+=$rltrim [[ $expref == *[^/] && $canpref == */ ]] && origpref+=/