mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Merge branch 'obsd-master'
This commit is contained in:
commit
c39dfb17ae
@ -254,7 +254,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
if (groupwith != NULL) {
|
if (groupwith != NULL) {
|
||||||
session_group_add(groupwith, s);
|
session_group_add(groupwith, s);
|
||||||
session_group_synchronize_to(s);
|
session_group_synchronize_to(s);
|
||||||
session_select(s, RB_ROOT(&s->windows)->idx);
|
session_select(s, RB_MIN(winlinks, &s->windows)->idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
19
format.c
19
format.c
@ -176,17 +176,6 @@ format_job_callback(struct job *job)
|
|||||||
fj->job = NULL;
|
fj->job = NULL;
|
||||||
free(fj->out);
|
free(fj->out);
|
||||||
|
|
||||||
if (WIFEXITED(job->status) && WEXITSTATUS(job->status) != 0) {
|
|
||||||
xasprintf(&fj->out, "<'%s' exited with %d>", fj->cmd,
|
|
||||||
WEXITSTATUS(job->status));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (WIFSIGNALED(job->status)) {
|
|
||||||
xasprintf(&fj->out, "<'%s' got signal %d>", fj->cmd,
|
|
||||||
WTERMSIG(job->status));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
buf = NULL;
|
buf = NULL;
|
||||||
if ((line = evbuffer_readline(job->event->input)) == NULL) {
|
if ((line = evbuffer_readline(job->event->input)) == NULL) {
|
||||||
len = EVBUFFER_LENGTH(job->event->input);
|
len = EVBUFFER_LENGTH(job->event->input);
|
||||||
@ -491,7 +480,7 @@ format_expand_time(struct format_tree *ft, const char *fmt, time_t t)
|
|||||||
char *
|
char *
|
||||||
format_expand(struct format_tree *ft, const char *fmt)
|
format_expand(struct format_tree *ft, const char *fmt)
|
||||||
{
|
{
|
||||||
char *buf, *tmp;
|
char *buf, *tmp, *cmd;
|
||||||
const char *ptr, *s;
|
const char *ptr, *s;
|
||||||
size_t off, len, n, slen;
|
size_t off, len, n, slen;
|
||||||
int ch, brackets;
|
int ch, brackets;
|
||||||
@ -531,10 +520,14 @@ format_expand(struct format_tree *ft, const char *fmt)
|
|||||||
tmp = xmalloc(n + 1);
|
tmp = xmalloc(n + 1);
|
||||||
memcpy(tmp, fmt, n);
|
memcpy(tmp, fmt, n);
|
||||||
tmp[n] = '\0';
|
tmp[n] = '\0';
|
||||||
|
cmd = format_expand(ft, tmp);
|
||||||
|
|
||||||
s = format_job_get(ft, tmp);
|
s = format_job_get(ft, cmd);
|
||||||
slen = strlen(s);
|
slen = strlen(s);
|
||||||
|
|
||||||
|
free(cmd);
|
||||||
|
free(tmp);
|
||||||
|
|
||||||
while (len - off < slen + 1) {
|
while (len - off < slen + 1) {
|
||||||
buf = xreallocarray(buf, 2, len);
|
buf = xreallocarray(buf, 2, len);
|
||||||
len *= 2;
|
len *= 2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user