diff options
author | 2013-03-25 10:05:35 +0000 | |
---|---|---|
committer | 2013-03-25 10:05:35 +0000 | |
commit | d5aaf01d7895f5191fbc5e0aa8ef52a907f2a447 (patch) | |
tree | 118b91d4a9a4fbe214942852af0c389d6bfbab76 /usr.bin/tmux/grid.c | |
parent | Print %%error not %%end guard on error, from George Nachman. (diff) | |
download | wireguard-openbsd-d5aaf01d7895f5191fbc5e0aa8ef52a907f2a447.tar.xz wireguard-openbsd-d5aaf01d7895f5191fbc5e0aa8ef52a907f2a447.zip |
Preserve trailing spaces with capture-pane -J, from George Nachman.
Diffstat (limited to 'usr.bin/tmux/grid.c')
-rw-r--r-- | usr.bin/tmux/grid.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/tmux/grid.c b/usr.bin/tmux/grid.c index 8842206f7f9..369beff2646 100644 --- a/usr.bin/tmux/grid.c +++ b/usr.bin/tmux/grid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grid.c,v 1.27 2013/03/25 10:01:43 nicm Exp $ */ +/* $OpenBSD: grid.c,v 1.28 2013/03/25 10:05:35 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -583,7 +583,7 @@ grid_string_cells_code(const struct grid_cell *lastgc, /* Convert cells into a string. */ char * grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx, - struct grid_cell **lastgc, int with_codes, int escape_c0) + struct grid_cell **lastgc, int with_codes, int escape_c0, int trim) { const struct grid_cell *gc; static struct grid_cell lastgc1; @@ -638,8 +638,10 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx, off += size; } - while (off > 0 && buf[off - 1] == ' ') - off--; + if (trim) { + while (off > 0 && buf[off - 1] == ' ') + off--; + } buf[off] = '\0'; return (buf); |