=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window.c,v retrieving revision 1.120 retrieving revision 1.121 diff -c -r1.120 -r1.121 *** src/usr.bin/tmux/window.c 2015/04/21 22:38:50 1.120 --- src/usr.bin/tmux/window.c 2015/04/22 15:05:03 1.121 *************** *** 1,4 **** ! /* $OpenBSD: window.c,v 1.120 2015/04/21 22:38:50 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window.c,v 1.121 2015/04/22 15:05:03 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 245,260 **** } } - int - window_index(struct window *s, u_int *i) - { - for (*i = 0; *i < ARRAY_LENGTH(&windows); (*i)++) { - if (s == ARRAY_ITEM(&windows, *i)) - return (0); - } - return (-1); - } - struct window * window_find_by_id(u_int id) { --- 245,250 ---- *************** *** 341,347 **** window_unzoom(w); ! if (window_index(w, &i) != 0) fatalx("index not found"); ARRAY_SET(&windows, i, NULL); while (!ARRAY_EMPTY(&windows) && ARRAY_LAST(&windows) == NULL) --- 331,341 ---- window_unzoom(w); ! for (i = 0; i < ARRAY_LENGTH(&windows); i++) { ! if (w == ARRAY_ITEM(&windows, i)) ! break; ! } ! if (i == ARRAY_LENGTH(&windows)) fatalx("index not found"); ARRAY_SET(&windows, i, NULL); while (!ARRAY_EMPTY(&windows) && ARRAY_LAST(&windows) == NULL)