[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

user/1547: two bugs in talk




>Number:         1547
>Category:       user
>Synopsis:       talk incorrectly displaying characters not in English charset
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec  7 15:50:01 MST 2000
>Last-Modified:
>Originator:     Igor Grabin
>Organization:
net
>Release:        openbsd-2.7 snapshot just before the release, talk as shipped
>Environment:
	
	System      : OpenBSD 2.7
	Architecture: OpenBSD.i386
	Machine     : i386
>Description:
talk doesn't display characters not in English charset 'as is'
as the code shows, it was somehow intended behaviour, but with charsets like
Russian this behaviour is a bit unwelcome :). there are two distinct problems:
1. isprint() rejecting any characters not in English charset
2. signness issue with waddch (see patch)
issue 1 is clear, issue 2 arises as soon as issue 1 is corrected - characters
greater than 0x80 get all of their attributes set once displayed
>How-To-Repeat:
	feed talk with mentioned chars.
>Fix:

--- display.c.old	Fri Dec  8 00:17:40 2000
+++ display.c	Fri Dec  8 00:29:59 2000
@@ -52,6 +52,9 @@
 xwin_t	his_win;
 WINDOW	*line_win;
 
+#undef isprint
+#define isprint(n) ((unsigned char)(n)>31)
+
 int	curses_initialized = 0;
 
 /*
@@ -157,7 +160,7 @@
 			cch = (*text & 63) + 64;
 			waddch(win->x_win, cch);
 		} else
-			waddch(win->x_win, *text);
+			waddch(win->x_win, (unsigned char)(*text));
 		getyx(win->x_win, win->x_line, win->x_col);
 		text++;
 	}

>Audit-Trail:
>Unformatted: