summaryrefslogtreecommitdiffstats
path: root/grid.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-03-30 19:44:55 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-03-30 19:44:55 +0000
commit6fdac02b532a7e0d0e7fc307ef40981f033c2493 (patch)
treed210385ce8fe519c1426a016075dd2fb6fe7d163 /grid.c
parent4db72582aa548875de9a8b4046670e74900e74e9 (diff)
Add UTF-8 to grid_compare..
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/grid.c b/grid.c
index b33559b7..a115d744 100644
--- a/grid.c
+++ b/grid.c
@@ -1,4 +1,4 @@
-/* $Id: grid.c,v 1.14 2009-03-28 20:17:29 nicm Exp $ */
+/* $Id: grid.c,v 1.15 2009-03-30 19:44:55 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -138,6 +138,7 @@ int
grid_compare(struct grid *ga, struct grid *gb)
{
struct grid_cell *gca, *gcb;
+ struct grid_utf8 *gua, *gub;
u_int xx, yy;
if (ga->sx != gb->sx || ga->sy != ga->sy)
@@ -151,7 +152,12 @@ grid_compare(struct grid *ga, struct grid *gb)
gcb = &gb->data[yy][xx];
if (memcmp(gca, gcb, sizeof (struct grid_cell)) != 0)
return (1);
- /* XXX */
+ if (!(gca->flags & GRID_FLAG_UTF8))
+ continue;
+ gua = &ga->udata[yy][xx];
+ gub = &gb->udata[yy][xx];
+ if (memcmp(gua, gub, sizeof (struct grid_utf8)) != 0)
+ return (1);
}
}