summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/dwm.c b/dwm.c
index 1554a16..3d9a063 100644
--- a/dwm.c
+++ b/dwm.c
@@ -459,16 +459,10 @@ destroynotify(XEvent *e) {
459 459
460void 460void
461detach(Client *c) { 461detach(Client *c) {
462 Client *i; 462 Client **tc;
463 463
464 if (c != clients) { 464 for(tc = &clients; *tc && *tc != c; tc = &(*tc)->next);
465 for(i = clients; i->next != c; i = i->next); 465 *tc = c->next;
466 i->next = c->next;
467 }
468 else {
469 clients = c->next;
470 }
471 c->next = NULL;
472} 466}
473 467
474void 468void