On Sat, 28 Sep 2013, Lior Kaplan wrote:

> On Fri, Sep 27, 2013 at 3:02 PM, Derick Rethans <der...@php.net> wrote:
> 
> > On Thu, 26 Sep 2013, Lior Kaplan wrote:
> >
> > > Hi,
> > >
> > > In Debian we build PHP for GNU/Hurd system, which need some minor fixes
> > > available here:
> > >
> > >
> > http://anonscm.debian.org/gitweb/?p=pkg-php/php.git;a=blob;f=debian/patches/116-posixness_fix.patch
> >
> >   46 --- php5.orig/main/php.h
> >   47 +++ php5/main/php.h
> >   48 @@ -244,6 +244,10 @@ END_EXTERN_C()
> >   49  /* macros */
> >   50  #define STR_PRINT(str) ((str)?(str):"")
> >   51
> >   52 +#ifndef PATH_MAX
> >   53 +#define PATH_MAX 4096
> >   54 +#endif
> >   55 +
> >   56  #ifndef MAXPATHLEN
> >   57  # ifdef PATH_MAX
> >   58  #  define MAXPATHLEN PATH_MAX
> >
> > That looks wrong. You're unconditionally defining PATH_MAX, but there is
> > logic in line 57 that deals with this too...
> 
> That whole section is about defining MAXPATHLEN, not PATH_MAX.

Sure it is, but currently that code reads:

#ifndef MAXPATHLEN
# ifdef PATH_MAX
#  define MAXPATHLEN PATH_MAX
# elif defined(MAX_PATH)
#  define MAXPATHLEN MAX_PATH
# else
#  define MAXPATHLEN 256    /* Should be safe for any weird systems that do not 
…
# endif
#endif

With your change, PATH_MAX is *always* defined, so the fallback to 
defined(MAX_PATH) - which is probably valid on some other platform - is 
no longer used. These lines were added by Ilia:

cd82349b (Ilia Alshanetsky     2005-12-20 14:24:24 +0000 250) # elif 
defined(MAX_PATH)
cd82349b (Ilia Alshanetsky     2005-12-20 14:24:24 +0000 251) #  define 
MAXPATHLEN MAX_PATH

With as comment:

commit cd82349b9e51c6986ede11f482f727e12717a6f5
Author: Ilia Alshanetsky <il...@php.net>
Date:   Tue Dec 20 14:24:24 2005 +0000

    Fixed bug #31347 (is_dir and is_file (incorrectly) return true for any
    string greater then 255 characters).

And bug 31347 is that was a fix for a specific issue on Windows:
https://bugs.php.net/bug.php?id=31347

cheers,
Derick

-- 
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Posted with an email client that doesn't mangle email: alpine
-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to