zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: cd bugs
Date: Wed, 15 Jul 2009 09:45:58 +0100	[thread overview]
Message-ID: <20090715094558.242c3b95@news01> (raw)
In-Reply-To: <loom.20090715T030318-95@post.gmane.org>

On Wed, 15 Jul 2009 03:28:53 +0000 (UTC)
Eric Blake <ebb9@byu.net> wrote:
> Eric Blake <ebb9 <at> 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 <pws@csr.com>            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'


  reply	other threads:[~2009-07-16  3:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-14 21:59 Eric Blake
2009-07-14 22:30 ` Eric Blake
2009-07-19 19:00   ` Peter Stephenson
2009-07-15  3:28 ` Eric Blake
2009-07-15  8:45   ` Peter Stephenson [this message]
2009-07-21  9:22 ` 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=20090715094558.242c3b95@news01 \
    --to=pws@csr.com \
    --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).