X-Git-Url: http://git.subgeniuskitty.com/xmenu/.git/blobdiff_plain/60ddf397e389f25f0a038548d9c808c83d815ba7..c4d552d669f23dbc842f3582b0b429a560addcc3:/xmenu.c diff --git a/xmenu.c b/xmenu.c index afb4301..9b3a250 100644 --- a/xmenu.c +++ b/xmenu.c @@ -432,6 +432,10 @@ buildmenutree(unsigned level, const char *label, const char *output, char *file) for (item = prevmenu->list; item->next != NULL; item = item->next) ; + /* a separator is no valid root for a submenu */ + if (!item->label) + errx(1, "a separator is no valid root for a submenu"); + prevmenu = menu; menu->caller = item; item->submenu = menu; @@ -717,8 +721,10 @@ setupmenu(struct Menu *menu, XClassHint *classh) /* set window title (used if wflag is on) */ if (menu->parent == NULL) { title = classh->res_name; - } else { + } else if (menu->caller->output) { title = menu->caller->output; + } else { + title = "\0"; } XStringListToTextProperty(&title, 1, &wintitle);