summaryrefslogtreecommitdiffstats
path: root/cmd-show-buffer.c
authortcunha <tcunha>2009-12-04 22:14:47 (GMT)
committer tcunha <tcunha>2009-12-04 22:14:47 (GMT)
commitf89ee4cd07adf6493f2c5c224f958807e2f8b12b (patch) (side-by-side diff)
treeb8ac63e29984038a96651afa16e106a9283fdc92 /cmd-show-buffer.c
parentf566ae6183c7a60b2cabf37f6923dba66d8b18dc (diff)
downloadtmux-old-f89ee4cd07adf6493f2c5c224f958807e2f8b12b.zip
tmux-old-f89ee4cd07adf6493f2c5c224f958807e2f8b12b.tar.gz
tmux-old-f89ee4cd07adf6493f2c5c224f958807e2f8b12b.tar.bz2
Sync OpenBSD patchset 581:
Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last time now I've configured emacs to make them displayed in really annoying colours...
Diffstat (limited to 'cmd-show-buffer.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cmd-show-buffer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd-show-buffer.c b/cmd-show-buffer.c
index 21c5dc6..0d9d9b5 100644
--- a/cmd-show-buffer.c
+++ b/cmd-show-buffer.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-show-buffer.c,v 1.11 2009/11/14 17:56:39 tcunha Exp $ */
+/* $Id: cmd-show-buffer.c,v 1.12 2009/12/04 22:14:47 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <[email protected]>
@@ -71,24 +71,24 @@ cmd_show_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
width = s->sx;
if (ctx->cmdclient != NULL)
width = ctx->cmdclient->tty.sx;
-
+
buf = xmalloc(width + 1);
len = 0;
-
+
ptr = in;
do {
buf[len++] = *ptr++;
-
+
if (len == width || buf[len - 1] == '\n') {
if (buf[len - 1] == '\n')
len--;
buf[len] = '\0';
- ctx->print(ctx, "%s", buf);
+ ctx->print(ctx, "%s", buf);
len = 0;
}
} while (*ptr != '\0');
-
+
if (len != 0) {
buf[len] = '\0';
ctx->print(ctx, "%s", buf);