Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2026-07-08 09:30:06 +01:00
6 changed files with 21 additions and 17 deletions

View File

@@ -438,6 +438,7 @@ server_destroy_session(struct session *s)
{
struct client *c;
struct session *s_new = NULL, *cs_new = NULL, *use_s;
struct sort_criteria sort_crit = { .order = SORT_NAME };
int detach_on_destroy;
detach_on_destroy = options_get_number(s->options, "detach-on-destroy");
@@ -446,9 +447,11 @@ server_destroy_session(struct session *s)
else if (detach_on_destroy == 2)
s_new = server_find_session(s, server_newer_detached_session);
else if (detach_on_destroy == 3)
s_new = session_previous_session(s, NULL);
s_new = session_previous_session(s, &sort_crit);
else if (detach_on_destroy == 4)
s_new = session_next_session(s, NULL);
s_new = session_next_session(s, &sort_crit);
if (s_new == s)
s_new = NULL;
/*
* If no suitable new session was found above, then look for any