summary refs log tree commit diff
path: root/src/funcs/cmv
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-08-31 22:06:41 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2009-08-31 22:06:41 +1000
commit7877713690c498bb74823542231a81362e8eedb3 (patch)
treef7c227dd0aa36bf058b130bc48a2fd9e2cf90d3e /src/funcs/cmv
parent[BUILTIN] Avoid compiler warnings on isdigit (diff)
downloaddash-7877713690c498bb74823542231a81362e8eedb3.tar.gz
dash-7877713690c498bb74823542231a81362e8eedb3.zip
[CD] Lookup PWD after going through CDPATH
On Tue, Jul 14, 2009 at 09:39:03PM +0000, Eric Blake wrote:
> 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

This patch fixes the problem.

Reported-by: Eric Blake <ebb9@byu.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'src/funcs/cmv')
0 files changed, 0 insertions, 0 deletions