author | Anselm R Garbe <garbeam@gmail.com> |
Thu, 03 Jul 2008 10:58:35 +0100 | |
changeset 1307 | 2c72f7c8826f |
parent 1306 | 5f55d9b819a2 |
child 1308 | 978d14197052 |
--- a/dwm.c Wed Jul 02 11:54:36 2008 +0100 +++ b/dwm.c Thu Jul 03 10:58:35 2008 +0100 @@ -459,16 +459,10 @@ void detach(Client *c) { - Client *i; + Client **tc; - if (c != clients) { - for(i = clients; i->next != c; i = i->next); - i->next = c->next; - } - else { - clients = c->next; - } - c->next = NULL; + for(tc = &clients; *tc && *tc != c; tc = &(*tc)->next); + *tc = c->next; } void