diff options
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 12 |
1 files changed, 3 insertions, 9 deletions
| @@ -459,16 +459,10 @@ destroynotify(XEvent *e) { | |||
| 459 | 459 | ||
| 460 | void | 460 | void |
| 461 | detach(Client *c) { | 461 | detach(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 | ||
| 474 | void | 468 | void |
