PERFORCE change 155135 for review
Ed Schouten
ed at FreeBSD.org
Mon Dec 22 15:57:33 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=155135
Change 155135 by ed at ed_dull on 2008/12/22 23:57:18
Some upstream changes to libteken. The important fix being:
- Don't print characters that have a width of zero columns.
Eventually we should do some special character processing with
it, but especially for a basic UTF-8 implementation, just
ignoring the characters is good enough.
Libteken already does a better job than the Linux console
driver (which also speaks UTF-8). The Linux console driver seems
to assume all characters have a width of 1 column.
Affected files ...
.. //depot/projects/mpsafetty/sys/dev/syscons/teken/teken.c#8 edit
.. //depot/projects/mpsafetty/sys/dev/syscons/teken/teken_subr.h#13 edit
Differences ...
==== //depot/projects/mpsafetty/sys/dev/syscons/teken/teken.c#8 (text+ko) ====
@@ -178,7 +178,7 @@
teken_pos_t tp = { .tp_row = 24, .tp_col = 80 };
#if !(defined(__FreeBSD__) && defined(_KERNEL))
- df = fopen("debuglog", "w");
+ df = fopen("teken.log", "w");
if (df != NULL)
setvbuf(df, NULL, _IOLBF, BUFSIZ);
#endif /* !(__FreeBSD__ && _KERNEL) */
==== //depot/projects/mpsafetty/sys/dev/syscons/teken/teken_subr.h#13 (text+ko) ====
@@ -511,15 +511,13 @@
teken_rect_t tr;
tr.tr_begin = t->t_cursor;
+ teken_subr_cursor_forward_tabulation(t, 1);
tr.tr_end.tp_row = tr.tr_begin.tp_row + 1;
-
- teken_subr_cursor_forward_tabulation(t, 1);
+ tr.tr_end.tp_col = t->t_cursor.tp_col;
/* Blank region that we skipped. */
- if (t->t_cursor.tp_col > tr.tr_begin.tp_col) {
- tr.tr_end.tp_col = t->t_cursor.tp_col;
+ if (tr.tr_end.tp_col > tr.tr_begin.tp_col)
teken_funcs_fill(t, &tr, BLANK, &t->t_curattr);
- }
}
static void
@@ -669,8 +667,9 @@
{
int width;
+ /* XXX: Don't process zero-width characters yet. */
width = teken_wcwidth(c);
- if (width < 0)
+ if (width <= 0)
return;
if (t->t_stateflags & TS_INSERT) {
More information about the p4-projects
mailing list