Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Dec 2008 23:57:32 GMT
From:      Ed Schouten <ed@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 155135 for review
Message-ID:  <200812222357.mBMNvWSR059315@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=155135

Change 155135 by ed@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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812222357.mBMNvWSR059315>