From c8bb465bb053559df85478901352142bf1886fdb Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Thu, 15 Apr 2010 01:09:22 +0200 Subject: [PATCH] Fix possible segfault when no [selbar] in config --- src/client.c | 1 - src/config.c | 1 - src/event.c | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/client.c b/src/client.c index ba2a393..23a7247 100644 --- a/src/client.c +++ b/src/client.c @@ -1186,7 +1186,6 @@ uicb_clientlist(uicb_t cmd) int n = 0; Window w; Client *c = NULL; - Bool is_sel; for(c = clients; c; c = c->next) if(c->tag == seltag[selscreen] && c->screen == selscreen) diff --git a/src/config.c b/src/config.c index b91d40c..f7176dc 100644 --- a/src/config.c +++ b/src/config.c @@ -176,7 +176,6 @@ conf_bar_section(void) conf.bars.height = fetch_opt_first(bar, "-1", "height").num; conf.colors.bar = getcolor(fetch_opt_first(bar, "#000000", "bg").str); conf.colors.text = fetch_opt_first(bar, "#ffffff", "fg").str; - conf.bars.selbar = fetch_opt_first(bar, "false", "selbar").bool; mouse = fetch_section(bar, "mouse"); diff --git a/src/event.c b/src/event.c index 25b54f0..28b0f01 100644 --- a/src/event.c +++ b/src/event.c @@ -99,7 +99,7 @@ buttonpress(XButtonEvent *ev) conf.bars.mouse[j].func(conf.bars.mouse[j].cmd); /* Selbar */ - if(ev->window == infobar[selscreen].selbar->win) + if(conf.bars.selbar && ev->window == infobar[selscreen].selbar->win) for(i = 0; i < conf.selbar.nmouse; ++i) if(conf.selbar.mouse[i].tag == seltag[conf.selbar.mouse[i].screen] || conf.selbar.mouse[i].tag < 0)