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

Re: webkit-1.8.0-2: Patches for review



On Mon, 2012-04-16 at 19:21 +0200, Samuel Thibault wrote:
> Svante Signell, le Mon 16 Apr 2012 18:07:54 +0200, a écrit :
> > No, doesn't look like it (from the ChangeLog):
> 
> Ok.

The only definition of *PATH_MAX to 1024 is in the autotools stuff!
Source/autotools/ltmain.sh:
#if defined(PATH_MAX)
# define LT_PATHMAX PATH_MAX
#elif defined(MAXPATHLEN)
# define LT_PATHMAX MAXPATHLEN
#else
# define LT_PATHMAX 1024
#endif

> > > > Problem with the patch is that the allocated string cannot easily be
> > > > freed:
> > > 
> > > You mean the string allocated in getCurrentExecutablePath()?  It's fine
> > > to keep it allocated all the time. Just make sure to store the pointer
> > > in a static variable, to be able to reuse the buffer next time the
> > > function is called.
> > 
> > Adding static to the CString definition or adding static when
> > allocating, like: static CString path = getCurrentExecutablePath();
> 
> No, I mean *inside* getCurrentExecutablePath. There used to be a static
> PATH_MAX char array; make it a static char * that gets reused each time.

char *readLinkBuffer; -> static char *readLinkBuffer;
similar to static char readLinkBuffer[PATH_MAX]; before?

So static works even if the memory allocated for the buffer is
malloced?? Of course the pointer remains the same, right??
What about if the result is a null pointer??

If OK I'll finish patch, and submit a bug report!


Reply to: