Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Jan 2009 00:20:18 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r186731 - head/sys/dev/syscons/teken
Message-ID:  <200901040020.n040KIcc041121@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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