diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-05-18 19:38:19 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-05-18 19:38:19 +0000 |
commit | d2528ecafc3d148cb179c41a989140b9755175dc (patch) | |
tree | 8939fd76d8124a5173cb200515f40dfdfa8e2a81 /app/cwm/group.c | |
parent | 9cc5b33194abf41c9d07c9748b22d6002735e433 (diff) |
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 'app/cwm/group.c')
-rw-r--r-- | app/cwm/group.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/app/cwm/group.c b/app/cwm/group.c index ba0bd36a5..bf4abac1d 100644 --- a/app/cwm/group.c +++ b/app/cwm/group.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: group.c,v 1.12 2008/05/15 22:18:00 oga Exp $ + * $Id: group.c,v 1.13 2008/05/18 19:38:18 oga Exp $ */ #include "headers.h" @@ -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); } |