[MPlayer-dev-eng] Re: [PATCH] fix for unconditional use of PATH_MAX

Robert Millan zeratul2 at wanadoo.es
Thu May 8 10:22:01 CEST 2003

On Wed, May 07, 2003 at 07:54:20PM +0400, Sergey Pinaev wrote:
> hi.
> On Wed, 7 May 2003 17:49:33 +0200
> Robert Millan <zeratul2 at wanadoo.es> wrote:
> RM> -      if (getcwd(cwd, PATH_MAX) != (char *)NULL)
> RM> +      cwd = getcwd (NULL, 0);
> If buf is NULL, the behaviour of getcwd() is undefined. (c) GETCWD(3)
> =) or =(

it's a GNU extension. to be compatible there should be an autoconf
test for that extension and declare an extended getcwd function if
the system libc doesn't provide the extension.

alternatively, i could just loop over getcwd malloc'ing a buffer and
checking for ERANGE errors untill getcwd succeeds.

which do you want me to do?

Robert Millan

make: *** No rule to make target `war'.  Stop.

Another world is possible - Just say no to genocide

More information about the MPlayer-dev-eng mailing list