mirror of
https://github.com/tmux/tmux.git
synced 2026-03-06 07:45:35 +00:00
Merge branch 'obsd-master'
This commit is contained in:
@@ -393,7 +393,7 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
const char *style = args_get(args, 's');
|
const char *style = args_get(args, 's');
|
||||||
const char *border_style = args_get(args, 'S');
|
const char *border_style = args_get(args, 'S');
|
||||||
char *cwd = NULL, *cause = NULL, **argv = NULL;
|
char *cwd = NULL, *cause = NULL, **argv = NULL;
|
||||||
char *title;
|
char *title = NULL;
|
||||||
int modify = popup_present(tc);
|
int modify = popup_present(tc);
|
||||||
int flags = -1, argc = 0;
|
int flags = -1, argc = 0;
|
||||||
enum box_lines lines = BOX_LINES_DEFAULT;
|
enum box_lines lines = BOX_LINES_DEFAULT;
|
||||||
@@ -417,8 +417,7 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
&cause);
|
&cause);
|
||||||
if (cause != NULL) {
|
if (cause != NULL) {
|
||||||
cmdq_error(item, "height %s", cause);
|
cmdq_error(item, "height %s", cause);
|
||||||
free(cause);
|
goto fail;
|
||||||
return (CMD_RETURN_ERROR);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -428,8 +427,7 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
&cause);
|
&cause);
|
||||||
if (cause != NULL) {
|
if (cause != NULL) {
|
||||||
cmdq_error(item, "width %s", cause);
|
cmdq_error(item, "width %s", cause);
|
||||||
free(cause);
|
goto fail;
|
||||||
return (CMD_RETURN_ERROR);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -438,7 +436,7 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
if (h > tty->sy)
|
if (h > tty->sy)
|
||||||
h = tty->sy;
|
h = tty->sy;
|
||||||
if (!cmd_display_menu_get_pos(tc, item, args, &px, &py, w, h))
|
if (!cmd_display_menu_get_pos(tc, item, args, &px, &py, w, h))
|
||||||
return (CMD_RETURN_NORMAL);
|
goto out;
|
||||||
|
|
||||||
value = args_get(args, 'd');
|
value = args_get(args, 'd');
|
||||||
if (value != NULL)
|
if (value != NULL)
|
||||||
@@ -478,8 +476,7 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
&cause);
|
&cause);
|
||||||
if (cause != NULL) {
|
if (cause != NULL) {
|
||||||
cmdq_error(item, "popup-border-lines %s", cause);
|
cmdq_error(item, "popup-border-lines %s", cause);
|
||||||
free(cause);
|
goto fail;
|
||||||
return (CMD_RETURN_ERROR);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -507,22 +504,29 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
|
|
||||||
if (modify) {
|
if (modify) {
|
||||||
popup_modify(tc, title, style, border_style, lines, flags);
|
popup_modify(tc, title, style, border_style, lines, flags);
|
||||||
free(title);
|
goto out;
|
||||||
return (CMD_RETURN_NORMAL);
|
|
||||||
}
|
}
|
||||||
if (popup_display(flags, lines, item, px, py, w, h, env, shellcmd, argc,
|
if (popup_display(flags, lines, item, px, py, w, h, env, shellcmd, argc,
|
||||||
argv, cwd, title, tc, s, style, border_style, NULL, NULL) != 0) {
|
argv, cwd, title, tc, s, style, border_style, NULL, NULL) != 0)
|
||||||
cmd_free_argv(argc, argv);
|
goto out;
|
||||||
if (env != NULL)
|
environ_free(env);
|
||||||
environ_free(env);
|
|
||||||
free(cwd);
|
|
||||||
free(title);
|
|
||||||
return (CMD_RETURN_NORMAL);
|
|
||||||
}
|
|
||||||
if (env != NULL)
|
|
||||||
environ_free(env);
|
|
||||||
free(cwd);
|
free(cwd);
|
||||||
free(title);
|
free(title);
|
||||||
cmd_free_argv(argc, argv);
|
cmd_free_argv(argc, argv);
|
||||||
return (CMD_RETURN_WAIT);
|
return (CMD_RETURN_WAIT);
|
||||||
|
|
||||||
|
out:
|
||||||
|
cmd_free_argv(argc, argv);
|
||||||
|
environ_free(env);
|
||||||
|
free(cwd);
|
||||||
|
free(title);
|
||||||
|
return (CMD_RETURN_NORMAL);
|
||||||
|
|
||||||
|
fail:
|
||||||
|
free(cause);
|
||||||
|
cmd_free_argv(argc, argv);
|
||||||
|
environ_free(env);
|
||||||
|
free(cwd);
|
||||||
|
free(title);
|
||||||
|
return (CMD_RETURN_ERROR);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
|
|
||||||
if (args_has(args, 'a')) {
|
if (args_has(args, 'a')) {
|
||||||
format_each(ft, cmd_display_message_each, item);
|
format_each(ft, cmd_display_message_each, item);
|
||||||
|
format_free(ft);
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,6 +156,5 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
free(msg);
|
free(msg);
|
||||||
|
|
||||||
format_free(ft);
|
format_free(ft);
|
||||||
|
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ environ_free(struct environ *env)
|
|||||||
{
|
{
|
||||||
struct environ_entry *envent, *envent1;
|
struct environ_entry *envent, *envent1;
|
||||||
|
|
||||||
|
if (env == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
RB_FOREACH_SAFE(envent, environ, env, envent1) {
|
RB_FOREACH_SAFE(envent, environ, env, envent1) {
|
||||||
RB_REMOVE(environ, env, envent);
|
RB_REMOVE(environ, env, envent);
|
||||||
free(envent->name);
|
free(envent->name);
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx,
|
|||||||
*/
|
*/
|
||||||
empty = 0;
|
empty = 0;
|
||||||
next_state = TTY_DRAW_LINE_DONE;
|
next_state = TTY_DRAW_LINE_DONE;
|
||||||
|
gcp = &grid_default_cell;
|
||||||
} else {
|
} else {
|
||||||
/* Get the current cell. */
|
/* Get the current cell. */
|
||||||
grid_view_get_cell(gd, px + i, py, &gc);
|
grid_view_get_cell(gd, px + i, py, &gc);
|
||||||
|
|||||||
Reference in New Issue
Block a user