mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-24 11:56:10 +02:00
Pass return code from _exec; allow command sequences to work from the command line.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: cmd-list-buffers.c,v 1.6 2009-01-18 17:20:52 nicm Exp $ */
|
||||
/* $Id: cmd-list-buffers.c,v 1.7 2009-01-19 18:23:40 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@@ -26,7 +26,7 @@
|
||||
* List paste buffers.
|
||||
*/
|
||||
|
||||
void cmd_list_buffers_exec(struct cmd *, struct cmd_ctx *);
|
||||
int cmd_list_buffers_exec(struct cmd *, struct cmd_ctx *);
|
||||
|
||||
const struct cmd_entry cmd_list_buffers_entry = {
|
||||
"list-buffers", "lsb",
|
||||
@@ -41,7 +41,7 @@ const struct cmd_entry cmd_list_buffers_entry = {
|
||||
cmd_target_print
|
||||
};
|
||||
|
||||
void
|
||||
int
|
||||
cmd_list_buffers_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
{
|
||||
struct cmd_target_data *data = self->data;
|
||||
@@ -52,7 +52,7 @@ cmd_list_buffers_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
size_t size, in, out;
|
||||
|
||||
if ((s = cmd_find_session(ctx, data->target)) == NULL)
|
||||
return;
|
||||
return (-1);
|
||||
|
||||
if (s->sx > 35) { /* leave three for ... */
|
||||
size = s->sx - 32;
|
||||
@@ -87,6 +87,5 @@ cmd_list_buffers_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
if (tmp != NULL)
|
||||
xfree(tmp);
|
||||
|
||||
if (ctx->cmdclient != NULL)
|
||||
server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0);
|
||||
return (0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user