Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code

This commit is contained in:
Nicholas Marriott 2013-10-01 23:50:24 +01:00
commit 13360ad541
9 changed files with 19 additions and 8 deletions

View File

@ -147,6 +147,9 @@ cmd_if_shell_done(struct cmd_q *cmdq1)
struct cmd_if_shell_data *cdata = cmdq1->data; struct cmd_if_shell_data *cdata = cmdq1->data;
struct cmd_q *cmdq = cdata->cmdq; struct cmd_q *cmdq = cdata->cmdq;
if (cmdq1->client_exit >= 0)
cmdq->client_exit = cmdq1->client_exit;
if (!cmdq_free(cmdq) && !cdata->bflag) if (!cmdq_free(cmdq) && !cdata->bflag)
cmdq_continue(cmdq); cmdq_continue(cmdq);

View File

@ -35,7 +35,7 @@ cmdq_new(struct client *c)
cmdq->dead = 0; cmdq->dead = 0;
cmdq->client = c; cmdq->client = c;
cmdq->client_exit = 0; cmdq->client_exit = -1;
TAILQ_INIT(&cmdq->queue); TAILQ_INIT(&cmdq->queue);
cmdq->item = NULL; cmdq->item = NULL;
@ -259,7 +259,7 @@ cmdq_continue(struct cmd_q *cmdq)
} while (cmdq->item != NULL); } while (cmdq->item != NULL);
empty: empty:
if (cmdq->client_exit) if (cmdq->client_exit > 0)
cmdq->client->flags |= CLIENT_EXIT; cmdq->client->flags |= CLIENT_EXIT;
if (cmdq->emptyfn != NULL) if (cmdq->emptyfn != NULL)
cmdq->emptyfn(cmdq); /* may free cmdq */ cmdq->emptyfn(cmdq); /* may free cmdq */

View File

@ -95,6 +95,9 @@ cmd_source_file_done(struct cmd_q *cmdq1)
{ {
struct cmd_q *cmdq = cmdq1->data; struct cmd_q *cmdq = cmdq1->data;
if (cmdq1->client_exit >= 0)
cmdq->client_exit = cmdq1->client_exit;
cmdq_free(cmdq1); cmdq_free(cmdq1);
cfg_references--; cfg_references--;

View File

@ -36,7 +36,7 @@ const struct cmd_entry cmd_split_window_entry = {
"[-dhvP] [-c start-directory] [-F format] [-p percentage|-l size] " "[-dhvP] [-c start-directory] [-F format] [-p percentage|-l size] "
CMD_TARGET_PANE_USAGE " [command]", CMD_TARGET_PANE_USAGE " [command]",
0, 0,
NULL, cmd_split_window_key_binding,
cmd_split_window_exec cmd_split_window_exec
}; };

View File

@ -33,7 +33,7 @@ enum cmd_retval cmd_wait_for_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_wait_for_entry = { const struct cmd_entry cmd_wait_for_entry = {
"wait-for", "wait", "wait-for", "wait",
"LSU", 1, 1, "LSU", 1, 1,
"[-LSU] channel", "[-L|-S|-U] channel",
0, 0,
NULL, NULL,
cmd_wait_for_exec cmd_wait_for_exec

View File

@ -121,7 +121,7 @@ format_create(void)
if (gethostname(host, sizeof host) == 0) { if (gethostname(host, sizeof host) == 0) {
format_add(ft, "host", "%s", host); format_add(ft, "host", "%s", host);
if ((ptr = strrchr(host, '.')) != NULL) if ((ptr = strchr(host, '.')) != NULL)
*ptr = '\0'; *ptr = '\0';
format_add(ft, "host_short", "%s", host); format_add(ft, "host_short", "%s", host);
} }

View File

@ -533,6 +533,9 @@ layout_resize_pane_mouse(struct client *c)
pane_border = 0; pane_border = 0;
if (m->event & MOUSE_EVENT_DRAG && m->flags & MOUSE_RESIZE_PANE) { if (m->event & MOUSE_EVENT_DRAG && m->flags & MOUSE_RESIZE_PANE) {
TAILQ_FOREACH(wp, &w->panes, entry) { TAILQ_FOREACH(wp, &w->panes, entry) {
if (!window_pane_visible(wp))
continue;
if (wp->xoff + wp->sx == m->lx && if (wp->xoff + wp->sx == m->lx &&
wp->yoff <= 1 + m->ly && wp->yoff <= 1 + m->ly &&
wp->yoff + wp->sy >= m->ly) { wp->yoff + wp->sy >= m->ly) {

2
tmux.1
View File

@ -3583,7 +3583,7 @@ If the command doesn't return success, the exit status is also displayed.
.D1 (alias: Ic info ) .D1 (alias: Ic info )
Show server information and terminal details. Show server information and terminal details.
.It Xo Ic wait-for .It Xo Ic wait-for
.Fl LSU .Op Fl L | S | U
.Ar channel .Ar channel
.Xc .Xc
.D1 (alias: Ic wait ) .D1 (alias: Ic wait )

6
tmux.c
View File

@ -184,7 +184,8 @@ makesocketpath(const char *label)
errno = ENOTDIR; errno = ENOTDIR;
return (NULL); return (NULL);
} }
if (sb.st_uid != uid || (sb.st_mode & (S_IRWXG|S_IRWXO)) != 0) { if (sb.st_uid != uid || (!S_ISDIR(sb.st_mode) &&
sb.st_mode & (S_IRWXG|S_IRWXO)) != 0) {
errno = EACCES; errno = EACCES;
return (NULL); return (NULL);
} }
@ -387,7 +388,8 @@ main(int argc, char **argv)
/* -L or default set. */ /* -L or default set. */
if (label != NULL) { if (label != NULL) {
if ((path = makesocketpath(label)) == NULL) { if ((path = makesocketpath(label)) == NULL) {
fprintf(stderr, "can't create socket\n"); fprintf(stderr, "can't create socket: %s\n",
strerror(errno));
exit(1); exit(1);
} }
} }