From 7877713690c498bb74823542231a81362e8eedb3 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Mon, 31 Aug 2009 22:06:41 +1000 Subject: [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 Signed-off-by: Herbert Xu --- ChangeLog | 1 + 1 file changed, 1 insertion(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index cb08ae5..d9dcb0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ 2009-08-31 Herbert Xu * Fix NUL termination in readcmd. + * Lookup PWD after going through CDPATH. 2009-08-11 Herbert Xu -- cgit 1.4.1