1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 05:18:06 +01:00

src/usermenu.c: updated wUserMenuRefreshInstances

remove unused var and move wwin check

Acked-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
David Maciejak
2014-05-18 00:27:40 +08:00
committed by Carlos R. Mafra
parent 867f221ead
commit 9456252d51

View File

@@ -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;