Tweak ordering.

This commit is contained in:
Nicholas Marriott 2007-09-21 18:35:16 +00:00
parent 248f78d29a
commit f145108258

View File

@ -1,4 +1,4 @@
/* $Id: session.c,v 1.11 2007-09-21 18:31:58 nicm Exp $ */
/* $Id: session.c,v 1.12 2007-09-21 18:35:16 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -130,16 +130,16 @@ int
session_detach(struct session *s, struct window *w)
{
window_remove(&s->windows, w);
if (ARRAY_EMPTY(&s->windows)) {
session_destroy(s);
return (1);
}
if (s->last == w)
s->last = NULL;
if (s->window == w && session_last(s) != 0 && session_previous(s) != 0)
session_next(s);
if (!ARRAY_EMPTY(&s->windows))
return (0);
session_destroy(s);
return (1);
return (0);
}
/* Return if session has window. */