Don't screw up UTF-8 combined characters.

This commit is contained in:
Nicholas Marriott
2009-01-26 20:57:45 +00:00
parent 514adbdb4d
commit 4d7e555a48
4 changed files with 187 additions and 17 deletions

View File

@ -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);