bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash-shipped getcwd() replacement does not work on interix.


From: Andreas Schwab
Subject: Re: bash-shipped getcwd() replacement does not work on interix.
Date: Thu, 20 Dec 2007 12:30:00 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux)

Michael Haubenwallner <address@hidden> 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, address@hidden
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."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]