summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2022-01-07 22:27:08 +0100
committerbakkeby <[email protected]>2022-01-07 22:27:08 +0100
commit9ea0cb6c7c6863f58c332438cc4dae1cc156db56 (patch)
treede8be6528cb4268529c709afe100575d5e575ec9
parent40d30e5d1bc4c1a57eab850657ad5818477ac153 (diff)
downloaddwm-flexipatch-9ea0cb6c7c6863f58c332438cc4dae1cc156db56.tar.gz
dwm-flexipatch-9ea0cb6c7c6863f58c332438cc4dae1cc156db56.zip
Fix for infinite loop when there is only one client and pushup is run twice
-rw-r--r--patch/push.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/patch/push.c b/patch/push.c
index 9410e61..68123a6 100644
--- a/patch/push.c
+++ b/patch/push.c
@@ -40,9 +40,11 @@ pushup(const Arg *arg)
} else {
/* move to the end */
for (c = sel; c->next; c = c->next);
- detach(sel);
- sel->next = NULL;
- c->next = sel;
+ if (sel != c) {
+ detach(sel);
+ sel->next = NULL;
+ c->next = sel;
+ }
}
focus(sel);
arrange(selmon);