From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14673 invoked from network); 26 Mar 2008 15:12:48 -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:12:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 94016 invoked from network); 26 Mar 2008 15:12:43 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Mar 2008 15:12:43 -0000 Received: (qmail 18679 invoked by alias); 26 Mar 2008 15:12:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24737 Received: (qmail 18669 invoked from network); 26 Mar 2008 15:12:38 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 26 Mar 2008 15:12:38 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTP id 7810780A2E1B for ; Wed, 26 Mar 2008 16:12:30 +0100 (CET) Received: from rly13d.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly13d.srv.mailcontrol.com (MailControl) with ESMTP id m2QFCRkV006584 for ; Wed, 26 Mar 2008 15:12:29 GMT Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly13d.srv.mailcontrol.com (MailControl) id m2QFBjpP002919 for zsh-workers@sunsite.dk; Wed, 26 Mar 2008 15:11:45 GMT Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly13d-eth0.srv.mailcontrol.com (envelope-sender Peter.Stephenson@csr.com) (MIMEDefang) with ESMTP id m2QFBbEJ002210; Wed, 26 Mar 2008 15:11:45 +0000 (GMT) Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Wed, 26 Mar 2008 15:05:52 +0000 Date: Wed, 26 Mar 2008 15:05:52 +0000 From: Peter Stephenson To: Baptiste Daroussin , zsh-workers@sunsite.dk Cc: Pea Subject: Re: _canonical_path not working on *BSD Message-ID: <20080326150552.52b3f1c4@news01> In-Reply-To: <20080326114413.80713vrmznwpnyuc@bapt.selfip.org> References: <20080326114413.80713vrmznwpnyuc@bapt.selfip.org> Organization: CSR X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.5; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 26 Mar 2008 15:05:52.0935 (UTC) FILETIME=[E2733370:01C88F52] X-Scanned-By: MailControl A-08-00-04 (www.mailcontrol.com) on 10.68.1.123 X-Virus-Scanned: ClamAV 0.91.2/6396/Wed Mar 26 12:29:12 2008 on bifrost X-Virus-Status: Clean On Wed, 26 Mar 2008 11:44:13 +0100 Baptiste Daroussin wrote: > Hi, > > _canonical_path is not working on freebsd, it rely on readlink which > does work the same on BSD : > on openbsd -q options doesn't exist : umount[tab] gives readlink: > unknown option -- q > on freebsd readlink: illegal option -- q Pea suggested just removing the -q, but probably we should also redirect stderr: Index: Completion/Unix/Type/_canonical_paths =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_canonical_paths,v retrieving revision 1.1 diff -u -r1.1 _canonical_paths --- Completion/Unix/Type/_canonical_paths 28 May 2006 18:36:06 -0000 1.1 +++ Completion/Unix/Type/_canonical_paths 26 Mar 2008 15:05:05 -0000 @@ -38,7 +38,8 @@ files=($@) else for __index in $@; do - files+=$(readlink -qf $__index) + # BSD doesn't have -q, so redirect stderr. + files+=$(readlink -f $__index 2>/dev/null) done fi @@ -48,7 +49,7 @@ expref=${~origpref} [[ $origpref == (|*/). ]] && rltrim=. curpref=${${expref%$rltrim}:-./} - canpref=$(readlink -qf $curpref) + canpref=$(readlink -f $curpref 2>/dev/null) if [[ $? -eq 0 ]]; then [[ $curpref == */ && $canpref == *[^/] ]] && canpref+=/ canpref+=$rltrim -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070