aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-06-01 20:32:41 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-06-01 20:32:41 +0000
commitcea201df20e918db06a2e9a01b1f144372522d9f (patch)
tree50a9badcf06162a4580a7baede82b06593915a41
parent65f4284e7fe796e19b6d0c2ba57becee5394e730 (diff)
downloadrtmux-cea201df20e918db06a2e9a01b1f144372522d9f.tar.gz
rtmux-cea201df20e918db06a2e9a01b1f144372522d9f.tar.bz2
rtmux-cea201df20e918db06a2e9a01b1f144372522d9f.zip
Don't die if no dst window and -k to linkw.
-rw-r--r--CHANGES4
-rw-r--r--cmd-link-window.c6
-rw-r--r--resize.c5
3 files changed, 10 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index 297f834b..f284576e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
01 June 2008
+* Bug fix: don't die if -k passed to link-window and the destination doesn't
+ exist.
* New command, send-keys, will send a set of keys to a window.
31 May 2008
@@ -314,4 +316,4 @@
(including mutt, emacs). No status bar yet and no key remapping or other
customisation.
-$Id: CHANGES,v 1.95 2008-06-01 20:20:25 nicm Exp $
+$Id: CHANGES,v 1.96 2008-06-01 20:32:41 nicm Exp $
diff --git a/cmd-link-window.c b/cmd-link-window.c
index 00e3b4a7..45cb4876 100644
--- a/cmd-link-window.c
+++ b/cmd-link-window.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-link-window.c,v 1.9 2007-12-06 09:46:21 nicm Exp $ */
+/* $Id: cmd-link-window.c,v 1.10 2008-06-01 20:32:41 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -138,6 +138,10 @@ cmd_link_window_exec(void *ptr, struct cmd_ctx *ctx)
data->dstidx = -1;
if (data->flag_kill && data->dstidx != -1) {
wl2 = winlink_find_by_index(&dst->windows, data->dstidx);
+ if (wl2 == NULL) {
+ ctx->error(ctx, "no window %d", data->dstidx);
+ return;
+ }
/*
* Can't use session_detach as it will destroy session if this
diff --git a/resize.c b/resize.c
index 94a7621b..4999c432 100644
--- a/resize.c
+++ b/resize.c
@@ -1,4 +1,4 @@
-/* $Id: resize.c,v 1.9 2007-12-06 09:46:22 nicm Exp $ */
+/* $Id: resize.c,v 1.10 2008-06-01 20:32:41 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -39,8 +39,7 @@
*
* As a side effect, this function updates the SESSION_UNATTACHED flag. This
* flag is necessary to make sure unattached sessions do not limit the size of
- * windows that are attached both to them and to other sessions which are
- * attached.
+ * windows that are attached both to them and to other (attached) sessions.
*/
void