From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13079 invoked from network); 26 Mar 2008 15:40: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:40:00 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 6056 invoked from network); 26 Mar 2008 15:39:49 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Mar 2008 15:39:49 -0000 Received: (qmail 7027 invoked by alias); 26 Mar 2008 15:39:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24744 Received: (qmail 7012 invoked from network); 26 Mar 2008 15:39:44 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 26 Mar 2008 15:39:44 -0000 Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [85.115.41.190]) by bifrost.dotsrc.org (Postfix) with ESMTP id EC4898097826 for ; Wed, 26 Mar 2008 16:39:37 +0100 (CET) Received: from rly12g.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly12g.srv.mailcontrol.com (MailControl) with ESMTP id m2QFcuNG022670 for ; Wed, 26 Mar 2008 15:39:24 GMT Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly12g.srv.mailcontrol.com (MailControl) id m2QFceC7020408 for zsh-workers@sunsite.dk; Wed, 26 Mar 2008 15:38:40 GMT Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly12g-eth0.srv.mailcontrol.com (envelope-sender Peter.Stephenson@csr.com) (MIMEDefang) with ESMTP id m2QFYQWY006051; Wed, 26 Mar 2008 15:38:40 +0000 (GMT) Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Wed, 26 Mar 2008 15:34:09 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id m2QFY9Bg017282; Wed, 26 Mar 2008 15:34:09 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id m2QFY9L1017279; Wed, 26 Mar 2008 15:34:09 GMT Message-Id: <200803261534.m2QFY9L1017279@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: Baptiste Daroussin cc: zsh-workers@sunsite.dk, Pea Subject: Re: _canonical_path not working on *BSD In-reply-to: <20080326162710.20476ooqf5nlulwc@bapt.selfip.org> References: <20080326114413.80713vrmznwpnyuc@bapt.selfip.org> <20080326150552.52b3f1c4@news01> <20080326162710.20476ooqf5nlulwc@bapt.selfip.org> Comments: In-reply-to Baptiste Daroussin message dated "Wed, 26 Mar 2008 16:27:10 +0100." Date: Wed, 26 Mar 2008 15:34:09 +0000 From: Peter Stephenson X-OriginalArrivalTime: 26 Mar 2008 15:34:09.0318 (UTC) FILETIME=[D592B460:01C88F56] X-Scanned-By: MailControl A-08-00-04 (www.mailcontrol.com) on 10.71.1.122 X-Virus-Scanned: ClamAV 0.91.2/6396/Wed Mar 26 12:29:12 2008 on bifrost X-Virus-Status: Clean Baptiste Daroussin wrote: > This only work on OpenBSD, readlink on FreeBSD doesn't allow -f. I think that means the function won't do what it's designed to do, right? So in that case we should test if readlink accepts -f and if it doesn't, then return immediately. However, that may not be a trivial test. How about something like [[ -n $(readlink -f / 2>&1 >/dev/null) ]] (for which we could cache the result)? Or is testing that "readlink -f / >&/dev/null" returns status 0 good enough? -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070