diff options
author | Thomas Adam <thomas@xteddy.org> | 2014-02-19 15:05:07 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2014-02-19 15:05:07 +0000 |
commit | ca1d78f5230e0c3ab4c3b15fff2597fbdb037b48 (patch) | |
tree | a9e33fd328e948a4ef9a57d6cc2fe3d82cbf128c | |
parent | b3de4a3dec85bc84bb83da6b46e2a8e2a634ace3 (diff) | |
parent | 6daf06b1ad61f67e9f7780d787451b9b5f82dd43 (diff) |
Merge branch 'obsd-master'
-rw-r--r-- | cmd-load-buffer.c | 1 | ||||
-rw-r--r-- | cmd-set-option.c | 6 | ||||
-rw-r--r-- | paste.c | 4 | ||||
-rw-r--r-- | server-client.c | 4 | ||||
-rw-r--r-- | window-copy.c | 4 |
5 files changed, 12 insertions, 7 deletions
diff --git a/cmd-load-buffer.c b/cmd-load-buffer.c index 6540aedc..2cb01b97 100644 --- a/cmd-load-buffer.c +++ b/cmd-load-buffer.c @@ -169,6 +169,7 @@ cmd_load_buffer_callback(struct client *c, int closed, void *data) /* No context so can't use server_client_msg_error. */ evbuffer_add_printf(c->stderr_data, "no buffer %d\n", *buffer); server_push_stderr(c); + free(pdata); } free(data); diff --git a/cmd-set-option.c b/cmd-set-option.c index 15b14f08..5ae4e5c3 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -307,11 +307,13 @@ cmd_set_option_set(struct cmd *self, struct cmd_q *cmdq, break; case OPTIONS_TABLE_COLOUR: o = cmd_set_option_colour(self, cmdq, oe, oo, value); - style_update_new(oo, o->name, oe->style); + if (o != NULL) + style_update_new(oo, o->name, oe->style); break; case OPTIONS_TABLE_ATTRIBUTES: o = cmd_set_option_attributes(self, cmdq, oe, oo, value); - style_update_new(oo, o->name, oe->style); + if (o != NULL) + style_update_new(oo, o->name, oe->style); break; case OPTIONS_TABLE_FLAG: o = cmd_set_option_flag(self, cmdq, oe, oo, value); @@ -130,8 +130,10 @@ paste_replace(struct paste_stack *ps, u_int idx, char *data, size_t size) { struct paste_buffer *pb; - if (size == 0) + if (size == 0) { + free(data); return (0); + } if (idx >= ARRAY_LENGTH(ps)) return (-1); diff --git a/server-client.c b/server-client.c index 3630a672..07ef5697 100644 --- a/server-client.c +++ b/server-client.c @@ -323,9 +323,9 @@ server_client_check_mouse(struct client *c, struct window_pane *wp) else if (statusat > 0 && m->y >= (u_int)statusat) m->y = statusat - 1; - /* Is this a pane selection? Allow down only in copy mode. */ + /* Is this a pane selection? */ if (options_get_number(oo, "mouse-select-pane") && - (m->event == MOUSE_EVENT_DOWN || wp->mode != &window_copy_mode)) { + (m->event == MOUSE_EVENT_DOWN || m->event == MOUSE_EVENT_WHEEL)) { window_set_active_at(wp->window, m->x, m->y); server_redraw_window_borders(wp->window); wp = wp->window->active; /* may have changed */ diff --git a/window-copy.c b/window-copy.c index 3e9ca492..527c95c2 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1455,8 +1455,8 @@ window_copy_copy_buffer(struct window_pane *wp, int idx, void *buf, size_t len) if (idx == -1) { limit = options_get_number(&global_options, "buffer-limit"); paste_add(&global_buffers, buf, len, limit); - } else - paste_replace(&global_buffers, idx, buf, len); + } else if (paste_replace(&global_buffers, idx, buf, len) != 0) + free(buf); } void |