From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10011 invoked from network); 2 Mar 2008 21:18:04 -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.5 required=5.0 tests=AWL,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; 2 Mar 2008 21:18:04 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 61227 invoked from network); 2 Mar 2008 21:17:57 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Mar 2008 21:17:57 -0000 Received: (qmail 27060 invoked by alias); 2 Mar 2008 21:17:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24656 Received: (qmail 27038 invoked from network); 2 Mar 2008 21:17:54 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 2 Mar 2008 21:17:54 -0000 Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bifrost.dotsrc.org (Postfix) with ESMTP id 7B2DC8028C4E for ; Sun, 2 Mar 2008 22:17:51 +0100 (CET) Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com with ESMTP id <20080302212038.IZOK19530.mtaout03-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com> for ; Sun, 2 Mar 2008 21:20:38 +0000 Received: from pws-pc ([81.107.42.63]) by aamtaout04-winn.ispmail.ntl.com with ESMTP id <20080302211753.DHJS29112.aamtaout04-winn.ispmail.ntl.com@pws-pc> for ; Sun, 2 Mar 2008 21:17:53 +0000 Date: Sun, 2 Mar 2008 21:17:44 +0000 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: Cannot cd into -- Message-ID: <20080302211744.50698d10@pws-pc> In-Reply-To: <20080229221008.2c5d417e@buddha> References: <20080229221008.2c5d417e@buddha> X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6081/Sun Mar 2 21:18:00 2008 on bifrost X-Virus-Status: Clean On Fri, 29 Feb 2008 22:10:08 +0100 "Matthias B." wrote: > It doesn't seem to be possible with zsh to cd into a directory named -- > > cd -- -- That's a bug, but possible not as egregious as you think: "cd -- -" changes to an entry on the directory stack (and it's special-cased so you don't need the leading "--"). There's no way around that, so if the directory were called "-2" you'd still need to use "./-2". Here it was treating the second - as a truncated negative number. This just fixes cd---I'm not sure if the shell should ever treat a - on its own in that fashion. Index: Src/builtin.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v retrieving revision 1.187 diff -u -r1.187 builtin.c --- Src/builtin.c 18 Feb 2008 03:18:03 -0000 1.187 +++ Src/builtin.c 2 Mar 2008 21:14:18 -0000 @@ -835,7 +835,8 @@ char *end; doprintdir++; - if (argv[0][1] && (argv[0][0] == '+' || argv[0][0] == '-')) { + if (argv[0][1] && (argv[0][0] == '+' || argv[0][0] == '-') + && strspn(argv[0]+1, "0123456789") == strlen(argv[0]+1)) { dd = zstrtol(argv[0] + 1, &end, 10); if (*end == '\0') { if ((argv[0][0] == '+') ^ isset(PUSHDMINUS)) -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/