summary refs log tree commit diff
path: root/src/cd.c (follow)
Commit message (Collapse)AuthorAge
* [CD] Lookup PWD after going through CDPATHHerbert Xu2009-08-31
| | | | | | | | | | | | | | | | | | | | | | | 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>
* [CD] Fixed getcwd build error for the non-glibc caseHerbert Xu2008-08-05
| | | | | | | | | | | | | | | | | | | | On Sat, Aug 02, 2008 at 01:24:16AM +0200, Peter Hartlich wrote: > > dash's debian/diff/0048--CD-Restored-warning-when-getcwd-fails.diff > contains the following lines: > > - return getcwd(buf, sizeof(buf)) ? savestr(buf) : nullstr; > + > + if (getcwd(buf, sizeof(buf)) > + return savestr(buf); > > The if condition is missing a closing parenthesis, which probably went > unnoticed because it occurs in a section only compiled if __GLIBC__ is > not defined. This patch adds the extra parenthesis. Thanks Peter. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [CD] Restored warning when getcwd failsHerbert Xu2008-05-03
| | | | | | | Somewhere along the lines the warning when getcwd fails went missing. This patch restores it. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [CD] Test __GLIBC__ instead of _GNU_SOURCEHerbert Xu2008-05-03
| | | | | | | AC_GNU_SOURCE always defines _GNU_SOURCE so testing it is pointless. This patch changes it to test __GLIBC__ instead. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [CD] Restored non-glibc getcwd supportHerbert Xu2008-05-02
| | | | | | | | | | These days dash is expected to build with libraries other than glibc so we need to support the old way of calling getcwd again. Thanks to Dan McGee for reporting this bug when dash is built with klibc. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* Copyright/licence updates and remove all traces of sys/cdefs.hHerbert Xu2005-10-29
| | | | | | | | | | | This change updates the BSD licence to the three-clause version since NetBSD has already done so. This makes dash GPL-compatible. It also adds Christos Zoulas (NetBSD ash maintainer) to the COPYING file. I've added "copyright by Herbert Xu" to most files. Finally all CVS IDs and inclusion of sys/cdefs.h have been removed. The latter is needed for support of klibc.
* Renamed error to sh_error.herbert2005-09-26
|
* Fixed cd - when OLDPWD is unset.herbert2005-09-26
|
* Initial import.Herbert Xu2005-09-26