svn commit: r186731 - head/sys/dev/syscons/teken
Kostik Belousov
kostikbel at gmail.com
Sun Jan 4 04:04:42 PST 2009
On Sun, Jan 04, 2009 at 12:20:18AM +0000, Ed Schouten wrote:
> 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);
IMHO, it would be much easier to try and use the new code if the
TEKEN_XXX defines would be implemented as both sysctl and kernel
tunables.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090104/a0bb5a07/attachment.pgp
More information about the svn-src-all
mailing list