From owner-p4-projects@FreeBSD.ORG Mon Dec 22 23:57:33 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 57B061065679; Mon, 22 Dec 2008 23:57:33 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C0751065678 for ; Mon, 22 Dec 2008 23:57:33 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 096838FC23 for ; Mon, 22 Dec 2008 23:57:33 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mBMNvW9K059318 for ; Mon, 22 Dec 2008 23:57:32 GMT (envelope-from ed@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mBMNvWSR059315 for perforce@freebsd.org; Mon, 22 Dec 2008 23:57:32 GMT (envelope-from ed@FreeBSD.org) Date: Mon, 22 Dec 2008 23:57:32 GMT Message-Id: <200812222357.mBMNvWSR059315@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ed@FreeBSD.org using -f From: Ed Schouten To: Perforce Change Reviews Cc: Subject: PERFORCE change 155135 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Dec 2008 23:57:33 -0000 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) {