diff -r c4b9f97e4bd7 -r 5b2240f2d21f dwm.c --- a/dwm.c Tue Jun 30 19:39:59 2009 +0100 +++ b/dwm.c Tue Jun 30 19:45:25 2009 +0100 @@ -600,14 +600,14 @@ void detachstack(Client *c) { - Client **tc; + Client **tc, *t; for(tc = &c->mon->stack; *tc && *tc != c; tc = &(*tc)->snext); *tc = c->snext; if(c == c->mon->sel) { - for(*tc = c->mon->stack; *tc && !ISVISIBLE((*tc)); *tc = (*tc)->snext); - c->mon->sel = *tc; + for(t = c->mon->stack; t && !ISVISIBLE(t); t = t->snext); + c->mon->sel = t; } }