From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5735 invoked from network); 16 Jul 2009 03:41:48 -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.4 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; 16 Jul 2009 03:41:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 43096 invoked from network); 15 Jul 2009 08:46:23 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Jul 2009 08:46:23 -0000 Received: (qmail 8584 invoked by alias); 15 Jul 2009 08:46:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27152 Received: (qmail 8565 invoked from network); 15 Jul 2009 08:46:11 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 15 Jul 2009 08:46:11 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [85.115.60.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 04504801E289 for ; Wed, 15 Jul 2009 10:46:07 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly47d.srv.mailcontrol.com (MailControl) with ESMTP id n6F8k2gX003223 for ; Wed, 15 Jul 2009 09:46:05 +0100 Received: from news01 ([10.99.50.25]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Wed, 15 Jul 2009 09:45:58 +0100 Date: Wed, 15 Jul 2009 09:45:58 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: cd bugs Message-ID: <20090715094558.242c3b95@news01> In-Reply-To: References: Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 15 Jul 2009 08:45:58.0795 (UTC) FILETIME=[ACB675B0:01CA0528] X-Scanned-By: MailControl A-09-20-00 (www.mailcontrol.com) on 10.68.0.157 X-Virus-Scanned: ClamAV 0.94.2/9569/Wed Jul 15 07:55:56 2009 on bifrost X-Virus-Status: Clean On Wed, 15 Jul 2009 03:28:53 +0000 (UTC) Eric Blake wrote: > Eric Blake byu.net> writes: > > > $ zsh -c 'emulate -R sh; CDPATH=///; cd eblake; /bin/pwd' > > //eblake > > $ bash -c 'CDPATH=///; cd eblake; /bin/pwd' > > bash: line 0: cd: eblake: No such file or directory > > /tmp > > $ > > Of the three examples mentioned in this thread, this one is definitely a bug, > but one that only affects platforms where // is special (which, based on the > __CYGWIN__ conditional in the source, appears to be just cygwin). Thanks, I've committed it. > Actually, in looking at this patch again, I'm starting to wonder if it > might be better to teach tricat that if the first argument ends in '/' > and the second argument is exactly "/", then it does not need to use the > second argument; this would certainly make it touch all code paths that > do file name concatenation, rather than trying to change down and protect > every caller of tricat with __CYGWIN__ conditionals. In other words, > there are probably also bugs with ~ expansion when $HOME is exactly / or > //, as well as other potential gotchas with // handling that I haven't > even investigated here. It would probably be better to introduce a pathtricat(), since tricat() isn't necessarily tied to paths; but it's possible similar issues occur with dupstring() or ztrdup(), too. It's certainly a danger this could happen elsewhere. -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK 'member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom'