summaryrefslogtreecommitdiffstats
path: root/screen-write.c
diff options
context:
space:
mode:
authornicm <nicm>2017-04-29 21:27:46 +0000
committernicm <nicm>2017-04-29 21:27:46 +0000
commita2dd7daf4e583ebb9ddc9d7cf09105c43df51399 (patch)
tree1b6356b8747873d2d596d59ecb21a474ec57a7d9 /screen-write.c
parent0f2f783584c62879a1182972e915f550bf23f00a (diff)
Fix UTF-8 combining characters in column 0, based on a diff from Keith
Winstein.
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/screen-write.c b/screen-write.c
index a034261e..14cbd4d5 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -1316,12 +1316,12 @@ screen_write_combine(struct screen_write_ctx *ctx, const struct utf8_data *ud,
fatalx("UTF-8 data empty");
/* Retrieve the previous cell. */
- for (n = 1; n < s->cx; n++) {
+ for (n = 1; n <= s->cx; n++) {
grid_view_get_cell(gd, s->cx - n, s->cy, &gc);
if (~gc.flags & GRID_FLAG_PADDING)
break;
}
- if (n == s->cx)
+ if (n > s->cx)
return (NULL);
*xx = s->cx - n;