-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Andreas Schwab on 12/20/2007 4:30 AM: >> + char *t = xmalloc(PATH_MAX); >> + the_current_working_directory = getcwd (t, PATH_MAX); > > The length of the cwd may be bigger than PATH_MAX.
On most systems, yes. Interix, however, probably follows suit with cygwin 1.5.x, since most Windows syscalls enforce that relative path names can't generate paths whose corresponding absolute path is longer than a puny 256 PATH_MAX (the cygwin developers are working towards avoiding this limitation in cygwin 1.7.0 by using lower-level NT syscalls that allow up to 32k in absolute length, and will be raising their PATH_MAX to at least the POSIX XSI minimum of 1k, but aren't there yet). But I agree that the patch as posted is wrong for non-Interix platforms. It may also be worth inspecting the gnulib replacement for getcwd, to see how it handles the problem: http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/getcwd.c - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHamw184KuGfSFAYARArOXAJkBwR6CbME0zyACCFbbe2g8XLmOKACgzdoJ Y0p53TTfWOrxjctD8Bkck2Q= =0ssG -----END PGP SIGNATURE-----