zsh-workers
 help / color / mirror / code / Atom feed
From: "Mika Seppänen" <cooz@ee.oulu.fi>
To: zsh-workers@sunsite.dk
Subject: Re: Problem with named directories
Date: Tue, 22 Feb 2005 19:29:36 +0200	[thread overview]
Message-ID: <7e0054ed1841058b16ca27361b02fe7c@ee.oulu.fi> (raw)

Hi all,

I write yesterday about problems with named directories. If I have 
following definations in my zshenv-file:

export foo="/home/user/dir/bar"
export bar="/fome/user/dir/bar/"

Both work with cd-command, but only foo expands correctly to ~foo (from 
%~ defination in prompt/title/etc). I write simple patch which changes 
cmpdir-function so that it returns zero when only difference between 
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 == '/')
         return 0;
+   if (!*t && *s == '/' && *(s+1) == '\0') {
+       *s = 0;
+       return 0;
+       }
      }
      return 1;
  }

Trailing slashs is removed to ensure that later use of that string 
wouldn't cause overflow.

Mika Seppänen

             reply	other threads:[~2005-02-22 17:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-22 17:29 Mika Seppänen [this message]
2005-02-22 18:03 ` Peter Stephenson
2005-02-22 18:18   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7e0054ed1841058b16ca27361b02fe7c@ee.oulu.fi \
    --to=cooz@ee.oulu.fi \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).