commit 600eae882dcdc04e57adda4f3f0d1c1627838aaa
parent 6e81fb2482a8fa80c93e6376f96e9cfcbf4c7515
Author: Claudio Alessi <smoppy@gmail.com>
Date: Wed, 26 Jul 2017 20:21:27 +0200
Fix cmdln_wdel()
Diffstat:
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/circo.c b/circo.c
@@ -387,10 +387,11 @@ cmdln_wdel(const Arg *arg) {
i = sel->cmdoff - 1;
while(i && sel->cmd[i] == ' ')
--i;
- while(i && sel->cmd[i] != ' ')
- --i;
- if(i)
- ++i;
+ if(i && isalnum(sel->cmd[i])) {
+ while(--i && isalnum(sel->cmd[i]));
+ if(i)
+ ++i;
+ }
memmove(&sel->cmd[i], &sel->cmd[sel->cmdoff], sel->cmdlen - sel->cmdoff);
sel->cmdlen -= sel->cmdoff - i;
sel->cmd[sel->cmdlen] = '\0';