DASH Shell discussions
 help / color / mirror / Atom feed
From: Eric Blake <ebb9@byu.net>
To: dash@vger.kernel.org
Subject: Re: bugs in cd
Date: Mon, 31 Aug 2009 05:28:16 -0600	[thread overview]
Message-ID: <4A9BB3D0.30504@byu.net> (raw)
In-Reply-To: <loom.20090714T212706-910@post.gmane.org>

According to Eric Blake on 7/14/2009 3:39 PM:
> For the cd command, POSIX 2008 requires that after all pathnames in CDPATH have 
> been tested and failed in step 5, then step 6 interprets the directory argument 
> relative to PWD.  In other words, this demonstrates a bug:
> 
> $ dash -c 'cd /tmp; mkdir -p foo; CDPATH=oops; cd foo; echo $?; pwd'
> cd: 1: can't cd to foo
> 2
> /tmp
> 
> while bash gets it correct:
> 
> $ bash -c 'cd /tmp; mkdir -p foo; CDPATH=oops; cd foo; echo $?; pwd'
> 0
> /tmp/foo
> 
> Furthermore, POSIX requires that if the element in CDPATH ends in slash, that 
> no additional slashes are added while forming the candidate curpath.  In light 
> of the fact that //home need not be the same directory as /home (and indeed, on 
> cygwin, they are distinct entities), this is also a bug:
> 
> $ dash -c 'CDPATH=/; cd home'
> //home
> $ bash -c 'CDPATH=/; cd home'
> /home

Ping.

-- 
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net

  reply	other threads:[~2009-08-31 11:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-14 21:39 bugs in cd Eric Blake
2009-08-31 11:28 ` Eric Blake [this message]
2009-08-31 12:07 ` Herbert Xu
2009-08-31 12:18 ` Herbert Xu
2009-08-31 12:23   ` Eric Blake
2009-08-31 12:56     ` Herbert Xu
2009-08-31 14:08       ` Eric Blake
2009-09-18  0:03         ` Eric Blake

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=4A9BB3D0.30504@byu.net \
    --to=ebb9@byu.net \
    --cc=dash@vger.kernel.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox