Update of /cvsroot/tmux/tmux
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv29370
Modified Files:
cmd-new-session.c cmd-switch-client.c server-client.c
server-fn.c tmux.h
Log Message:
Sync OpenBSD patchset 802:
Use pointer rather than index for the client's last session.
Index: server-fn.c
===================================================================
RCS file: /cvsroot/tmux/tmux/server-fn.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- server-fn.c 11 Dec 2010 18:42:20 -0000 1.114
+++ server-fn.c 22 Dec 2010 15:31:00 -0000 1.115
@@ -399,7 +399,7 @@
c->session = NULL;
c->flags |= CLIENT_EXIT;
} else {
- c->last_session = UINT_MAX;
+ c->last_session = NULL;
c->session = s_new;
server_redraw_client(c);
}
Index: server-client.c
===================================================================
RCS file: /cvsroot/tmux/tmux/server-client.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- server-client.c 11 Dec 2010 18:42:20 -0000 1.47
+++ server-client.c 22 Dec 2010 15:31:00 -0000 1.48
@@ -77,7 +77,7 @@
c->title = NULL;
c->session = NULL;
- c->last_session = UINT_MAX;
+ c->last_session = NULL;
c->tty.sx = 80;
c->tty.sy = 24;
Index: cmd-new-session.c
===================================================================
RCS file: /cvsroot/tmux/tmux/cmd-new-session.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- cmd-new-session.c 11 Dec 2010 18:42:20 -0000 1.79
+++ cmd-new-session.c 22 Dec 2010 15:31:00 -0000 1.80
@@ -122,7 +122,7 @@
cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_new_session_data *data = self->data;
- struct session *s, *groupwith;
+ struct session *s, *old_s, *groupwith;
struct window *w;
struct window_pane *wp;
struct environ env;
@@ -279,17 +279,16 @@
if (!detached) {
if (ctx->cmdclient != NULL) {
server_write_client(ctx->cmdclient, MSG_READY, NULL, 0);
- if (ctx->cmdclient->session != NULL) {
- session_index(ctx->cmdclient->session,
- &ctx->cmdclient->last_session);
- }
+
+ old_s = ctx->cmdclient->session;
+ if (old_s != NULL)
+ ctx->cmdclient->last_session = old_s;
ctx->cmdclient->session = s;
server_redraw_client(ctx->cmdclient);
} else {
- if (ctx->curclient->session != NULL) {
- session_index(ctx->curclient->session,
- &ctx->curclient->last_session);
- }
+ old_s = ctx->curclient->session;
+ if (old_s != NULL)
+ ctx->curclient->last_session = old_s;
ctx->curclient->session = s;
server_redraw_client(ctx->curclient);
}
Index: tmux.h
===================================================================
RCS file: /cvsroot/tmux/tmux/tmux.h,v
retrieving revision 1.588
retrieving revision 1.589
diff -u -d -r1.588 -r1.589
--- tmux.h 22 Dec 2010 15:28:51 -0000 1.588
+++ tmux.h 22 Dec 2010 15:31:00 -0000 1.589
@@ -1153,7 +1153,7 @@
struct mode_key_data prompt_mdata;
struct session *session;
- u_int last_session;
+ struct session *last_session;
int references;
};
Index: cmd-switch-client.c
===================================================================
RCS file: /cvsroot/tmux/tmux/cmd-switch-client.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- cmd-switch-client.c 11 Dec 2010 18:42:20 -0000 1.22
+++ cmd-switch-client.c 22 Dec 2010 15:31:00 -0000 1.23
@@ -159,9 +159,8 @@
return (-1);
}
} else if (data->flag_last) {
- if (c->last_session != UINT_MAX &&
- c->last_session < ARRAY_LENGTH(&sessions))
- s = ARRAY_ITEM(&sessions, c->last_session);
+ if (c->last_session != NULL && session_alive(c->last_session))
+ s = c->last_session;
if (s == NULL) {
ctx->error(ctx, "can't find last session");
return (-1);
@@ -172,7 +171,7 @@
return (-1);
if (c->session != NULL)
- session_index(c->session, &c->last_session);
+ c->last_session = c->session;
c->session = s;
recalculate_sizes();
------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months. Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs