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

Re: serious bug. Evolution and Microsoft mentality.



While I agree with your statements, it's strictly not possible in this
case - realpath() requires that the second argument be a string buffer
of size PATH_MAX (read the manpage).

SYNOPSIS
     #include <stdlib.h>

     char *realpath(const char *file_name, char *resolved_name);

DESCRIPTION
     The realpath() function derives, from the  pathname  pointed
     to  by  file_name,  an absolute pathname that names the same
     file, whose resolution does not involve ".", "..",  or  sym-
     bolic links.  The generated pathname is stored, up to a max-
     imum  of  PATH_MAX  bytes,  in  the  buffer  pointed  to  by
     resolved_name.


Jeff

On Thu, 2002-01-10 at 13:27, Jeroen Dekkers wrote:
> On Thu, Jan 10, 2002 at 12:38:30PM -0500, Jeffrey Stedfast wrote:
> > Actually the attached patch is the "correct one". There is no need to
> > memset and you should use PATH_MAX rather than 4096.
> 
> Both is incorrect. PATH_MAX isn't required by POSIX and some systems
> don't have it (the Hurd for example). The Hurd simply doesn't have a
> limit (the GNU Coding Standards says arbitrary limits should be
> avoided, they are bad (think about the 640k limit, 1024 cylinder
> limit, etc)). If we have to define some limit it would be so large
> that it is not suitable for static allocation. You should use dynamic
> allocation and not limit you in any way.
> 
> Jeroen Dekkers
> -- 
> Jabber supporter - http://www.jabber.org Jabber ID: jdekkers@jabber.org
> Debian GNU supporter - http://www.debian.org http://www.gnu.org
> IRC: jeroen@openprojects.net
-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj@ximian.com  - www.ximian.com



Reply to: