From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24143 invoked from network); 22 Feb 2005 17:29:54 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Feb 2005 17:29:54 -0000 Received: (qmail 84049 invoked from network); 22 Feb 2005 17:29:48 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Feb 2005 17:29:48 -0000 Received: (qmail 22379 invoked by alias); 22 Feb 2005 17:29:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20842 Received: (qmail 22363 invoked from network); 22 Feb 2005 17:29:40 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Feb 2005 17:29:40 -0000 Received: (qmail 83667 invoked from network); 22 Feb 2005 17:29:40 -0000 Received: from gw15.rotuaari.net (HELO gw15.virtues.local) (212.50.147.115) by a.mx.sunsite.dk with SMTP; 22 Feb 2005 17:29:34 -0000 Received: from [10.20.41.232] (unknown [212.50.147.121]) by gw15.virtues.local (Postfix) with ESMTP id 1442A42506C for ; Tue, 22 Feb 2005 19:29:23 +0200 (EET) Mime-Version: 1.0 (Apple Message framework v619.2) Content-Transfer-Encoding: quoted-printable Message-Id: <7e0054ed1841058b16ca27361b02fe7c@ee.oulu.fi> Content-Type: text/plain; charset=ISO-8859-1; format=flowed To: zsh-workers@sunsite.dk From: =?ISO-8859-1?Q?Mika_Sepp=E4nen?= Subject: Re: Problem with named directories Date: Tue, 22 Feb 2005 19:29:36 +0200 X-Mailer: Apple Mail (2.619.2) X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.5 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.5 Hi all, I write yesterday about problems with named directories. If I have=20 following definations in my zshenv-file: export foo=3D"/home/user/dir/bar" export bar=3D"/fome/user/dir/bar/" Both work with cd-command, but only foo expands correctly to ~foo (from=20= %~ defination in prompt/title/etc). I write simple patch which changes=20= cmpdir-function so that it returns zero when only difference between=20 strings A and B is that A's last character is slash. diff -ruN zsh-4.3-20050221/Src/utils.c zsh-work/Src/utils.c --- zsh-4.3-20050221/Src/utils.c Tue Feb 1 12:53:18 2005 +++ zsh-work/Src/utils.c Tue Feb 22 18:57:58 2005 @@ -620,6 +620,10 @@ return 0; if (!*s && *t =3D=3D '/') return 0; + if (!*t && *s =3D=3D '/' && *(s+1) =3D=3D '\0') { + *s =3D 0; + return 0; + } } return 1; } Trailing slashs is removed to ensure that later use of that string=20 wouldn't cause overflow. Mika Sepp=E4nen=