diff options
Diffstat (limited to 'usr.bin/tmux/status.c')
-rw-r--r-- | usr.bin/tmux/status.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c index a6469dee67e..18f244fea13 100644 --- a/usr.bin/tmux/status.c +++ b/usr.bin/tmux/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.31 2009/09/07 10:49:32 nicm Exp $ */ +/* $OpenBSD: status.c,v 1.32 2009/09/07 18:50:45 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -928,9 +928,10 @@ status_prompt_key(struct client *c, int key) case MODEKEYEDIT_PASTE: if ((pb = paste_get_top(&c->session->buffers)) == NULL) break; - if ((last = strchr(pb->data, '\n')) == NULL) - last = strchr(pb->data, '\0'); - n = last - pb->data; + for (n = 0; n < pb->size; n++) { + if (pb->data[n] < 32 || pb->data[n] == 127) + break; + } c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + n + 1); if (c->prompt_index == size) { |