aboutsummaryrefslogtreecommitdiff
path: root/screen-write.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-26 20:57:45 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-26 20:57:45 +0000
commit4d7e555a48a6fb0732565b24482d24e968f49eae (patch)
treee7647855793af4ebf18188191d21d19ffb9c3127 /screen-write.c
parent514adbdb4d05007063bc1462d80b1d64a2e62230 (diff)
downloadrtmux-4d7e555a48a6fb0732565b24482d24e968f49eae.tar.gz
rtmux-4d7e555a48a6fb0732565b24482d24e968f49eae.tar.bz2
rtmux-4d7e555a48a6fb0732565b24482d24e968f49eae.zip
Don't screw up UTF-8 combined characters.
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/screen-write.c b/screen-write.c
index 87b57382..9c3b6654 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -1,4 +1,4 @@
-/* $Id: screen-write.c,v 1.28 2009-01-19 17:15:19 nicm Exp $ */
+/* $Id: screen-write.c,v 1.29 2009-01-26 20:57:44 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -520,6 +520,10 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
else
width = 1;
+ /* Discard zero-width characters. */
+ if (width == 0)
+ return;
+
/* If the character is wider than the screen, don't print it. */
if (width > screen_size_x(s)) {
memcpy(&tc, gc, sizeof tc);