aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-06 15:37:15 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-06 15:37:15 +0000
commit9cddd796ffef383893b5fd4e228f4d18673a77bd (patch)
tree995d7305b6d749eefbbeaf922f9fecf0c3031b63 /server.c
parent7fef12b4910fccf1b3c390f39e620448e5a9415b (diff)
downloadrtmux-9cddd796ffef383893b5fd4e228f4d18673a77bd.tar.gz
rtmux-9cddd796ffef383893b5fd4e228f4d18673a77bd.tar.bz2
rtmux-9cddd796ffef383893b5fd4e228f4d18673a77bd.zip
Prompt history.
Diffstat (limited to 'server.c')
-rw-r--r--server.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/server.c b/server.c
index 1605afef..f42a3aa0 100644
--- a/server.c
+++ b/server.c
@@ -1,4 +1,4 @@
-/* $Id: server.c,v 1.87 2008-12-13 18:06:08 nicm Exp $ */
+/* $Id: server.c,v 1.88 2009-01-06 15:37:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -507,6 +507,8 @@ server_accept_client(int srv_fd)
c->in = buffer_create(BUFSIZ);
c->out = buffer_create(BUFSIZ);
+ ARRAY_INIT(&c->prompt_hdata);
+
c->tty.fd = -1;
c->title = NULL;
@@ -569,6 +571,20 @@ server_lost_client(struct client *c)
tty_free(&c->tty);
+ if (c->title != NULL)
+ xfree(c->title);
+
+ if (c->message_string != NULL)
+ xfree(c->message_string);
+
+ if (c->prompt_string != NULL)
+ xfree(c->prompt_string);
+ if (c->prompt_buffer != NULL)
+ xfree(c->prompt_buffer);
+ for (i = 0; i < ARRAY_LENGTH(&c->prompt_hdata); i++)
+ xfree(ARRAY_ITEM(&c->prompt_hdata, i));
+ ARRAY_FREE(&c->prompt_hdata);
+
close(c->fd);
buffer_destroy(c->in);
buffer_destroy(c->out);