libxfce4util broken(was: Xffm creates bad files)

edscott wilson garcia edscott at imp.mx
Wed Mar 31 01:49:07 CEST 2004


El mar, 30-03-2004 a las 14:03, Benedikt Meurer escribió:
> Olivier Fourdan wrote:
> > Edscott,
> > 
> > A question that pops in my mind (ie I did not dig into the code), did
> > you free the returned value? I think it should not be freed. But again,
> > I did not even look at the code, so I have no idea of what I'm talking
> > about.
> 
> No, Edscott is right. The problem is in libxfce4util. Appended a simple 
> program that illustrates the problem. I've done some debugging on this, but I 
> haven't figured out whats wrong so far. Both xfce_get_userfile_r and 
> xfce_get_homefile_r seem to be broken. The code is quite simple, but for some 
> reason I cannot seem to find the problem. Any help would be appreciated.

For xfce_get_userfile_r() I think it might be best to change the way the
function works and make it return a gchar* which should be freed by the
user when no longer needed. 
Or if a const gchar* is possible by an inline macro, use that instead. 
For a home directory this works as a const gchar* and never returns
NULL:

#define XFCE_HOME (g_get_home_dir()?g_get_home_dir():g_get_tmp_dir())

That's more the way gtk and glib work and it makes for easier coding.

just my $0.02. If you want me to fix the library I'll proceed that way.

regards,

Edscott


> 
> regards,
> Benedikt




More information about the Xfce4-dev mailing list