Subject: bin/2874: talk messes up national characters
To: None <gnats-bugs@gnats.netbsd.org>
From: Matthias Scheler <tron@lyssa.owl.de>
List: netbsd-bugs
Date: 10/21/1996 01:21:11
>Number:         2874
>Category:       bin
>Synopsis:       talk messes up national characters
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 20 16:35:02 1996
>Last-Modified:
>Originator:     Matthias Scheler
>Organization:
Matthias Scheler
tron@lyssa.owl.de
>Release:        1.2
>Environment:
System: NetBSD lyssa 1.2 NetBSD 1.2 (LYSSA) #0: Thu Oct 3 03:44:13 MET DST 1996 tron@lyssa:/usr/src/sys/arch/i386/compile/LYSSA i386


>Description:
NetBSD's "talk" messes up national characters. It contains a hard coded
character range check and prints out everything not in that range as
"^" followed by (ASCII & 63) + 64.

>How-To-Repeat:
Without a patched libc like mine (if I find the time I'll write some local
code) you won't be able to reproduce it. If you have such a beast you
only have to use a national character in a talk window.

>Fix:
*** display.c.orig	Sat Oct 14 04:26:00 1995
--- display.c	Mon Oct 21 01:12:37 1996
*************** static char rcsid[] = "$NetBSD: display.
*** 44,49 ****
--- 44,50 ----
   * The window 'manager', initializes curses and handles the actual
   * displaying of text
   */
+ #include <ctype.h>
  #include "talk.h"
  
  xwin_t	my_win;
*************** display(win, text, size)
*** 139,145 ****
  			/* check for wraparound */
  			xscroll(win, 0);
  		}
! 		if (*text < ' ' && *text != '\t') {
  			waddch(win->x_win, '^');
  			getyx(win->x_win, win->x_line, win->x_col);
  			if (win->x_col == COLS-1) /* check for wraparound */
--- 140,146 ----
  			/* check for wraparound */
  			xscroll(win, 0);
  		}
! 		if ( !isprint(*text) && *text != '\t') {
  			waddch(win->x_win, '^');
  			getyx(win->x_win, win->x_line, win->x_col);
  			if (win->x_col == COLS-1) /* check for wraparound */
>Audit-Trail:
>Unformatted: