[Xfce4-commits] <xfce4-settings:master> Add hardcoded fallback if menu is not found.

Nick Schermer noreply at xfce.org
Fri Apr 13 21:48:01 CEST 2012


Updating branch refs/heads/master
         to f4fd807f906195ed358a1d6d04e510f4f70372a7 (commit)
       from c8a67210474f9e46f02cf4f00111201f1dd207db (commit)

commit f4fd807f906195ed358a1d6d04e510f4f70372a7
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Apr 13 21:39:16 2012 +0200

    Add hardcoded fallback if menu is not found.
    
    This fixes a possible segfault if null is send to garcon
    when the menu is not found by xfce_resource_lookup.

 xfce4-settings-manager/Makefile.am                 |    3 +--
 .../xfce-settings-manager-dialog.c                 |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xfce4-settings-manager/Makefile.am b/xfce4-settings-manager/Makefile.am
index 2fee266..c6bdc2d 100644
--- a/xfce4-settings-manager/Makefile.am
+++ b/xfce4-settings-manager/Makefile.am
@@ -1,7 +1,6 @@
 INCLUDES = \
 	-I${top_srcdir} \
-	-DDATADIR=\"$(datadir)\" \
-	-DSRCDIR=\"$(top_srcdir)\" \
+	-DMENUFILE=\"$(sysconfdir)/xdg/menus/xfce-settings-manager.menu\" \
 	-DLOCALEDIR=\"$(localedir)\" \
 	-DG_LOG_DOMAIN=\"xfce4-settings-manager\" \
 	$(PLATFORM_CPPFLAGS)
diff --git a/xfce4-settings-manager/xfce-settings-manager-dialog.c b/xfce4-settings-manager/xfce-settings-manager-dialog.c
index 4d8ea74..e2f9aa4 100644
--- a/xfce4-settings-manager/xfce-settings-manager-dialog.c
+++ b/xfce4-settings-manager/xfce-settings-manager-dialog.c
@@ -177,7 +177,7 @@ xfce_settings_manager_dialog_init (XfceSettingsManagerDialog *dialog)
                                         G_TYPE_STRING);
 
     path = xfce_resource_lookup (XFCE_RESOURCE_CONFIG, "menus/xfce-settings-manager.menu");
-    dialog->menu = garcon_menu_new_for_path (path);
+    dialog->menu = garcon_menu_new_for_path (path != NULL ? path : MENUFILE);
     g_free (path);
 
     gtk_window_set_default_size (GTK_WINDOW (dialog), 640, 500);


More information about the Xfce4-commits mailing list