mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-16 08:38:12 +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-attach-session.c,v 1.36 2010-02-08 18:27:34 tcunha Exp $ */
|
||||
/* $Id: cmd-attach-session.c,v 1.37 2010-12-22 15:36:44 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -47,7 +47,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
char *overrides, *cause;
|
||||
u_int i;
|
||||
|
||||
if (ARRAY_LENGTH(&sessions) == 0) {
|
||||
if (RB_EMPTY(&sessions)) {
|
||||
ctx->error(ctx, "no sessions");
|
||||
return (-1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user