diff -r e238dc4844d7 -r e8f627998d6f cmd.c --- a/cmd.c Wed Jul 12 00:53:11 2006 +0200 +++ b/cmd.c Wed Jul 12 15:17:22 2006 +0200 @@ -23,16 +23,18 @@ sel(void *aux) { const char *arg = aux; - Client *c; + Client *c = NULL; if(!arg || !stack) return; if(!strncmp(arg, "next", 5)) - focus(stack->snext ? stack->snext : stack); - else if(!strncmp(arg, "prev", 5)) { + c = stack->snext ? stack->snext : stack; + else if(!strncmp(arg, "prev", 5)) for(c = stack; c && c->snext; c = c->snext); - focus(c ? c : stack); - } + if(!c) + c = stack; + raise(c); + focus(c); } void