summaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cmd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/cmd.c b/cmd.c
index c14c3e6..baa3ae9 100644
--- a/cmd.c
+++ b/cmd.c
@@ -23,16 +23,18 @@ void
23sel(void *aux) 23sel(void *aux)
24{ 24{
25 const char *arg = aux; 25 const char *arg = aux;
26 Client *c; 26 Client *c = NULL;
27 27
28 if(!arg || !stack) 28 if(!arg || !stack)
29 return; 29 return;
30 if(!strncmp(arg, "next", 5)) 30 if(!strncmp(arg, "next", 5))
31 focus(stack->snext ? stack->snext : stack); 31 c = stack->snext ? stack->snext : stack;
32 else if(!strncmp(arg, "prev", 5)) { 32 else if(!strncmp(arg, "prev", 5))
33 for(c = stack; c && c->snext; c = c->snext); 33 for(c = stack; c && c->snext; c = c->snext);
34 focus(c ? c : stack); 34 if(!c)
35 } 35 c = stack;
36 raise(c);
37 focus(c);
36} 38}
37 39
38void 40void