diff options
Diffstat (limited to 'cmd-rename-window.c')
-rw-r--r-- | cmd-rename-window.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/cmd-rename-window.c b/cmd-rename-window.c index 93af5be5..5bb4db5a 100644 --- a/cmd-rename-window.c +++ b/cmd-rename-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-rename-window.c,v 1.18 2008-06-03 16:55:09 nicm Exp $ */ +/* $Id: cmd-rename-window.c,v 1.19 2008-06-04 17:54:26 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -118,15 +118,10 @@ cmd_rename_window_exec(void *ptr, struct cmd_ctx *ctx) if (data == NULL) return; - if ((s = cmd_find_session(ctx, data->cname, data->sname)) == NULL) + wl = cmd_find_window(ctx, data->cname, data->sname, data->idx, &s); + if (wl == NULL) return; - if (data->idx == -1) - wl = s->curw; - else if ((wl = winlink_find_by_index(&s->windows, data->idx)) == NULL) { - ctx->error(ctx, "no window %d", data->idx); - return; - } xfree(wl->window->name); wl->window->name = xstrdup(data->newname); |