summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/status.c')
-rw-r--r--usr.bin/tmux/status.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c
index 950e6f8e67d..4d18ad4037e 100644
--- a/usr.bin/tmux/status.c
+++ b/usr.bin/tmux/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.133 2015/08/28 12:16:28 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.134 2015/08/29 09:25:00 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -815,10 +815,9 @@ status_prompt_key(struct client *c, int key)
struct options *oo = &sess->options;
struct paste_buffer *pb;
char *s, *first, *last, word[64], swapc;
- const char *histstr;
- const char *wsep = NULL;
+ const char *histstr, *bufdata, *wsep = NULL;
u_char ch;
- size_t size, n, off, idx;
+ size_t size, n, off, idx, bufsize;
size = strlen(c->prompt_buffer);
switch (mode_key_lookup(&c->prompt_mdata, key, NULL)) {
@@ -1067,24 +1066,25 @@ status_prompt_key(struct client *c, int key)
c->flags |= CLIENT_STATUS;
break;
case MODEKEYEDIT_PASTE:
- if ((pb = paste_get_top()) == NULL)
+ if ((pb = paste_get_top(NULL)) == NULL)
break;
- for (n = 0; n < pb->size; n++) {
- ch = (u_char) pb->data[n];
+ bufdata = paste_buffer_data(pb, &bufsize);
+ for (n = 0; n < bufsize; n++) {
+ ch = (u_char)bufdata[n];
if (ch < 32 || ch == 127)
break;
}
c->prompt_buffer = xrealloc(c->prompt_buffer, size + n + 1);
if (c->prompt_index == size) {
- memcpy(c->prompt_buffer + c->prompt_index, pb->data, n);
+ memcpy(c->prompt_buffer + c->prompt_index, bufdata, n);
c->prompt_index += n;
c->prompt_buffer[c->prompt_index] = '\0';
} else {
memmove(c->prompt_buffer + c->prompt_index + n,
c->prompt_buffer + c->prompt_index,
size + 1 - c->prompt_index);
- memcpy(c->prompt_buffer + c->prompt_index, pb->data, n);
+ memcpy(c->prompt_buffer + c->prompt_index, bufdata, n);
c->prompt_index += n;
}