=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/grid.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- src/usr.bin/tmux/grid.c 2013/03/25 10:01:43 1.27 +++ src/usr.bin/tmux/grid.c 2013/03/25 10:05:35 1.28 @@ -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 @@ -583,7 +583,7 @@ /* 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 @@ off += size; } - while (off > 0 && buf[off - 1] == ' ') - off--; + if (trim) { + while (off > 0 && buf[off - 1] == ' ') + off--; + } buf[off] = '\0'; return (buf);