DASH Shell discussions
 help / color / mirror / Atom feed
From: Eric Blake <ebb9@byu.net>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: dash@vger.kernel.org
Subject: Re: bugs in cd
Date: Mon, 31 Aug 2009 06:23:27 -0600	[thread overview]
Message-ID: <4A9BC0BF.30608@byu.net> (raw)
In-Reply-To: <20090831121822.GC7311@gondor.apana.org.au>

According to Herbert Xu on 8/31/2009 6:18 AM:
> On Tue, Jul 14, 2009 at 09:39:03PM +0000, Eric Blake wrote:
>> 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:
> 
> Can you quote where POSIX says this?

Which version of POSIX are you looking at?  POSIX 2008 added quite a few
clarifications about the handling of // that were not listed in POSIX 2001.

http://www.opengroup.org/onlinepubs/9699919799/utilities/cd.html

"5. Starting with the first pathname in the <colon>-separated pathnames of
CDPATH (see the ENVIRONMENT VARIABLES section) if the pathname is
non-null, test if the concatenation of that pathname, a <slash> character
if that pathname did not end with a <slash> character, and the directory
operand names a directory."...

In other words, if CDPATH is "/", then you should not append any
additional <slash> characters, such that you end up checking for the
existence of "/foo", not "//foo".

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

Eric Blake             ebb9@byu.net

  reply	other threads:[~2009-08-31 12:23 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
2009-08-31 12:07 ` Herbert Xu
2009-08-31 12:18 ` Herbert Xu
2009-08-31 12:23   ` Eric Blake [this message]
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=4A9BC0BF.30608@byu.net \
    --to=ebb9@byu.net \
    --cc=dash@vger.kernel.org \
    --cc=herbert@gondor.apana.org.au \
    /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