Latest Exp Panel segfaulting

Biju Chacko botsie at xfce.org
Wed Sep 21 09:14:40 CEST 2005


Jasper Huijsmans wrote:
> Biju Chacko schreef:
> 
>>This fixes it
>>
>>Index: panel/panel-item-manager.c
>>===================================================================
>>--- panel/panel-item-manager.c  (revision 17710)
>>+++ panel/panel-item-manager.c  (working copy)
>>@@ -218,7 +218,7 @@
>>          dirs = xfce_resource_dirs (XFCE_RESOURCE_DATA);
>>      }
>>
>>-    for (d = dirs; *d != NULL || !datadir_used; ++d)
>>+    for (d = dirs; *d != NULL && !datadir_used; ++d)
>>      {
>>          GDir *gdir;
>>          char *dirname;
>>
> 
> 
> Unfortunately, this is wrong. I _really_ don't understand why that would 
> work.

That would only work if xfce_resource_dirs() returns a valid list. If it 
returned NULL, then even the install prefix wouldn't be checked. So 
you're right, '&&' is wrong.

> 
> The goal of this code is to make sure that the installation prefix is 
> searched even when it is not part of the resource directories.
> 
> How about this?
> 
> Index: panel-item-manager.c
> ===================================================================
> --- panel-item-manager.c        (revision 17710)
> +++ panel-item-manager.c        (working copy)
> @@ -274,6 +274,9 @@
> 
>           g_free (dirname);
>           g_dir_close (gdir);
> +
> +        if (*d == NULL)
> +            break;
>       }
> 
>       g_strfreev (dirs);

Much better. Works correctly, unlike the previous fix -- which resulted 
in a weird empty panel thingy which I was debugging. Though I suspect 
that was due to some other issue.

-- b




More information about the Xfce4-dev mailing list