diff options
Diffstat (limited to 'cmd.c')
-rw-r--r-- | cmd.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -1,4 +1,4 @@ -/* $Id: cmd.c,v 1.43 2008-06-05 21:25:00 nicm Exp $ */ +/* $Id: cmd.c,v 1.44 2008-06-05 22:59:38 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -313,14 +313,15 @@ cmd_find_window(struct cmd_ctx *ctx, const char *arg, struct session **sp) s = ctx->cursession; if (s == NULL) s = cmd_current_session(ctx); - if (s != NULL) { - if (idx == -1) - wl = s->curw; - else - wl = winlink_find_by_index(&s->windows, idx); - } + if (s == NULL) + return (NULL); if (sp != NULL) *sp = s; + + if (idx == -1) + wl = s->curw; + else + wl = winlink_find_by_index(&s->windows, idx); if (wl == NULL) ctx->error(ctx, "window not found: %s:%d", s->name, idx); return (wl); |