diff options
author | nicm <nicm> | 2015-08-29 09:25:00 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-08-29 09:25:00 +0000 |
commit | b56958500036970023c7a53264331cd10a5bbed2 (patch) | |
tree | 4e919788d8f30a08c048d573449a79e03fc06cc1 /status.c | |
parent | b9f0571780e7058a70a8cc3b6805b6f1a73061e0 (diff) |
Move struct paste_buffer out of tmux.h.
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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; } |