From owner-svn-src-head@FreeBSD.ORG Sun Jan 4 00:20:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B7AB106566B; Sun, 4 Jan 2009 00:20:19 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A48C8FC19; Sun, 4 Jan 2009 00:20:19 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n040KIg3041123; Sun, 4 Jan 2009 00:20:18 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n040KIcc041121; Sun, 4 Jan 2009 00:20:18 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200901040020.n040KIcc041121@svn.freebsd.org> From: Ed Schouten Date: Sun, 4 Jan 2009 00:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186731 - head/sys/dev/syscons/teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jan 2009 00:20:19 -0000 Author: ed Date: Sun Jan 4 00:20:18 2009 New Revision: 186731 URL: http://svn.freebsd.org/changeset/base/186731 Log: Print control characters, even though they are normally not visible. With cons25, there are printable characters below 0x1B. This is not the case with ASCII, UTF-8, etc. but in this case we just have to. Also don't set LC_CTYPE to UTF-8 when libteken is compiled without UTF-8 in the demo-application. Modified: head/sys/dev/syscons/teken/teken.c head/sys/dev/syscons/teken/teken_demo.c Modified: head/sys/dev/syscons/teken/teken.c ============================================================================== --- head/sys/dev/syscons/teken/teken.c Sun Jan 4 00:12:01 2009 (r186730) +++ head/sys/dev/syscons/teken/teken.c Sun Jan 4 00:20:18 2009 (r186731) @@ -53,10 +53,14 @@ static FILE *df; #include "teken_wcwidth.h" #else /* !TEKEN_UTF8 */ static inline int -teken_wcwidth(teken_char_t c) +teken_wcwidth(teken_char_t c __unused) { +#ifdef TEKEN_CONS25 + return (1); +#else /* !TEKEN_CONS25 */ return (c <= 0x1B) ? -1 : 1; +#endif /* TEKEN_CONS25 */ } #endif /* TEKEN_UTF8 */ Modified: head/sys/dev/syscons/teken/teken_demo.c ============================================================================== --- head/sys/dev/syscons/teken/teken_demo.c Sun Jan 4 00:12:01 2009 (r186730) +++ head/sys/dev/syscons/teken/teken_demo.c Sun Jan 4 00:20:18 2009 (r186731) @@ -280,7 +280,9 @@ main(int argc __unused, char *argv[] __u exit(1); case 0: setenv("TERM", "cons25", 1); +#ifdef TEKEN_UTF8 setenv("LC_CTYPE", "UTF-8", 0); +#endif /* TEKEN_UTF8 */ execlp("zsh", "-zsh", NULL); execlp("bash", "-bash", NULL); execlp("sh", "-sh", NULL);