If no target client is specified to commands which accept one, try to guess the

current client, in a similar manner to how sessions already work: if the
current session can be established and has only one client, use that; otherwise
use the most recently created client.
This commit is contained in:
Nicholas Marriott
2009-10-05 18:30:54 +00:00
parent 45043ebf3e
commit 4ca2200d83
3 changed files with 53 additions and 2 deletions

View File

@ -90,6 +90,9 @@ server_create_client(int fd)
c = xcalloc(1, sizeof *c);
c->references = 0;
imsg_init(&c->ibuf, fd);
if (gettimeofday(&c->tv, NULL) != 0)
fatal("gettimeofday failed");
ARRAY_INIT(&c->prompt_hdata);