Michael Haubenwallner <[EMAIL PROTECTED]> writes: > diff -ru builtins/common.c builtins/common.c > --- builtins/common.c Wed Dec 19 10:30:07 2007 > +++ builtins/common.c Wed Dec 19 10:34:58 2007 > @@ -479,11 +479,8 @@ > > if (the_current_working_directory == 0) > { > -#if defined (GETCWD_BROKEN) > - the_current_working_directory = getcwd (0, PATH_MAX); > -#else > - the_current_working_directory = getcwd (0, 0); > -#endif > + char *t = xmalloc(PATH_MAX); > + the_current_working_directory = getcwd (t, PATH_MAX);
The length of the cwd may be bigger than PATH_MAX. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."