From 9456252d515a0399e9461ec6b90146db798bd6a4 Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Sun, 18 May 2014 00:27:40 +0800 Subject: [PATCH] src/usermenu.c: updated wUserMenuRefreshInstances remove unused var and move wwin check Acked-by: Christophe CURIS --- src/usermenu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/usermenu.c b/src/usermenu.c index 4a669c9c..c349810a 100644 --- a/src/usermenu.c +++ b/src/usermenu.c @@ -279,7 +279,6 @@ static WMenu *configureUserMenu(WScreen * scr, WMPropList * plum) void wUserMenuRefreshInstances(WMenu * menu, WWindow * wwin) { - WMenuEntry *entry; int i, j, count, paintflag; paintflag = 0; @@ -335,7 +334,7 @@ WMenu *wUserMenuGet(WScreen * scr, WWindow * wwin) WMenu *menu = NULL; char *path = NULL; char *tmp; - if (wwin->wm_instance && wwin->wm_class) { + if (wwin && wwin->wm_instance && wwin->wm_class) { int len = strlen(wwin->wm_instance) + strlen(wwin->wm_class) + 7; tmp = wmalloc(len); snprintf(tmp, len, "%s.%s.menu", wwin->wm_instance, wwin->wm_class); @@ -345,9 +344,7 @@ WMenu *wUserMenuGet(WScreen * scr, WWindow * wwin) if (!path) return NULL; - if (wwin) - menu = readUserMenuFile(scr, path); - + menu = readUserMenuFile(scr, path); wfree(path); } return menu; -- 2.11.4.GIT