mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-18 09:30:04 +02:00
Sync OpenBSD patchset 806:
Store sessions in an RB tree by name rather than a list, this is tidier and allows them to easily be shown sorted in various lists (list-sessions/choose-sessions). Keep a session index which is used in a couple of places internally but make it an ever-increasing number rather than filling in gaps with new sessions.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: cmd-list-sessions.c,v 1.25 2009-11-28 14:50:36 tcunha Exp $ */
|
||||
/* $Id: cmd-list-sessions.c,v 1.26 2010-12-22 15:36:44 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@@ -46,14 +46,10 @@ cmd_list_sessions_exec(unused struct cmd *self, struct cmd_ctx *ctx)
|
||||
struct session *s;
|
||||
struct session_group *sg;
|
||||
char *tim, tmp[64];
|
||||
u_int i, idx;
|
||||
u_int idx;
|
||||
time_t t;
|
||||
|
||||
for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
|
||||
s = ARRAY_ITEM(&sessions, i);
|
||||
if (s == NULL)
|
||||
continue;
|
||||
|
||||
RB_FOREACH(s, sessions, &sessions) {
|
||||
sg = session_group_find(s);
|
||||
if (sg == NULL)
|
||||
*tmp = '\0';
|
||||
|
Reference in New Issue
Block a user