=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window.c,v retrieving revision 1.102 retrieving revision 1.103 diff -c -r1.102 -r1.103 *** src/usr.bin/tmux/window.c 2014/02/22 18:01:10 1.102 --- src/usr.bin/tmux/window.c 2014/03/31 21:41:07 1.103 *************** *** 1,4 **** ! /* $OpenBSD: window.c,v 1.102 2014/02/22 18:01:10 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window.c,v 1.103 2014/03/31 21:41:07 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 423,432 **** void window_pane_active_lost(struct window_pane *wp, struct window_pane *nextwp) { ! struct layout_cell *lc, *lc2; /* Save the target pane in its parent. */ ! nextwp->layout_cell->parent->lastwp = nextwp; /* * Save the source pane in all of its parents up to, but not including, --- 423,437 ---- void window_pane_active_lost(struct window_pane *wp, struct window_pane *nextwp) { ! struct layout_cell *lc, *lc2, *lcparent; + /* Get the parent cell. */ + lcparent = nextwp->layout_cell->parent; + if (lcparent == NULL) + return; + /* Save the target pane in its parent. */ ! lcparent->lastwp = nextwp; /* * Save the source pane in all of its parents up to, but not including, *************** *** 435,442 **** if (wp == NULL) return; for (lc = wp->layout_cell->parent; lc != NULL; lc = lc->parent) { ! lc2 = nextwp->layout_cell->parent; ! for (; lc2 != NULL; lc2 = lc2->parent) { if (lc == lc2) return; } --- 440,446 ---- if (wp == NULL) return; for (lc = wp->layout_cell->parent; lc != NULL; lc = lc->parent) { ! for (lc2 = lcparent; lc2 != NULL; lc2 = lc2->parent) { if (lc == lc2) return; }