diff options
author | oga <oga> | 2008-05-18 19:38:18 +0000 |
---|---|---|
committer | oga <oga> | 2008-05-18 19:38:18 +0000 |
commit | 5c402536fa7dfe6805ab1cb9e1cd96feaaf69c41 (patch) | |
tree | 1eca7cceed6f3c033f8f8296a19b70ddbdfd9275 /group.c | |
parent | a21a064a9b0d15239f72d5e6d5d9181fc387a427 (diff) | |
download | cwm-5c402536fa7dfe6805ab1cb9e1cd96feaaf69c41.tar.gz cwm-5c402536fa7dfe6805ab1cb9e1cd96feaaf69c41.tar.xz cwm-5c402536fa7dfe6805ab1cb9e1cd96feaaf69c41.zip |
group_ctx->name is only used in this one function, and for now it
corresponds directly to the static list of group names. Just use the static list and stop strdup()ing a new version for the context struct. Since that never got freed this also fixes a small memleak. Kill some unused variables while i'm here. ok okan@
Diffstat (limited to 'group.c')
-rw-r--r-- | group.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/group.c b/group.c index 5d6175a..5fc01be 100644 --- a/group.c +++ b/group.c @@ -24,10 +24,8 @@ #define CALMWM_NGROUPS 9 -int Groupnamemode = 0; struct group_ctx *Group_active = NULL; struct group_ctx Groups[CALMWM_NGROUPS]; -char Group_name[256]; int Grouphideall = 0; struct group_ctx_q Groupq; @@ -266,16 +264,13 @@ group_menu(XButtonEvent *e) if (TAILQ_EMPTY(&gc->clients)) continue; - if (gc->name == NULL) - gc->name = xstrdup(shortcut_to_name[gc->shortcut]); - XCALLOC(mi, struct menu); if (gc->hidden) snprintf(mi->text, sizeof(mi->text), "%d: [%s]", - gc->shortcut, gc->name); + gc->shortcut, shortcut_to_name[gc->shortcut]); else snprintf(mi->text, sizeof(mi->text), "%d: %s", - gc->shortcut, gc->name); + gc->shortcut, shortcut_to_name[gc->shortcut]); mi->ctx = gc; TAILQ_INSERT_TAIL(&menuq, mi, entry); } |