tsimplified detach() - dwm - [fork] customized build of dwm, the dynamic window manager
(HTM) git clone git://src.adamsgaard.dk/dwm
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit f529d41ca1792455bbae29e008af3c27c3a49df5
(DIR) parent 45768ee04bfab45a5dfd21105419806422ca8954
(HTM) Author: Anselm R Garbe <garbeam@gmail.com>
Date: Thu, 3 Jul 2008 10:58:35 +0100
simplified detach()
Diffstat:
M dwm.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
---
(DIR) diff --git a/dwm.c b/dwm.c
t@@ -459,16 +459,10 @@ destroynotify(XEvent *e) {
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