From owner-freebsd-hackers Tue Feb 27 11:53:34 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from nebula.cybercable.fr (d217.dhcp212-126.cybercable.fr [212.198.126.217]) by hub.freebsd.org (Postfix) with ESMTP id C982137B719 for ; Tue, 27 Feb 2001 11:53:24 -0800 (PST) (envelope-from mux@qualys.com) Received: (from mux@localhost) by nebula.cybercable.fr (8.11.2/8.11.2) id f1RJrAQ02032 for hackers@freebsd.org; Tue, 27 Feb 2001 20:53:10 +0100 (CET) (envelope-from mux) Date: Tue, 27 Feb 2001 20:53:09 +0100 From: Maxime Henrion To: hackers@freebsd.org Subject: talk(1) patch to allow 8bits characters Message-ID: <20010227205309.D345@nebula.cybercable.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, talk(1) uses the isprint() function to determine if a character is printable. If it's not, it outputs '^' followed by the character without his 8th bit. However, isprint() and friends are broken currently on FreeBSD (at least on -STABLE), so it will never recognize an accentued character as printable. The attached patch remove the isprint() test so that it's possible to write special characters. It also removes the now useless setlocale() call and headers. When locale support will be complete, I'm volunteer to re-introduce this check if someone thinks it's really worth it. Could someone review this ? Thanks, Maxime -- Don't be fooled by cheap finnish imitations ; BSD is the One True Code Key fingerprint = F9B6 1D5A 4963 331C 88FC CA6A AB50 1EF2 8CBE 99D6 Public Key : http://www.epita.fr/~henrio_m/ --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="talk.diff" diff -cr talk/display.c /usr/src/usr.bin/talk/display.c *** talk/display.c Tue Feb 27 20:35:30 2001 --- /usr/src/usr.bin/talk/display.c Tue Feb 27 20:39:02 2001 *************** *** 44,50 **** * displaying of text */ #include "talk.h" - #include xwin_t my_win; xwin_t his_win; --- 44,49 ---- *************** *** 150,162 **** text++; continue; } ! if (!isprint((unsigned char)*text) && *text != '\t') { ! waddch(win->x_win, '^'); ! getyx(win->x_win, win->x_line, win->x_col); ! cch = (*text & 63) + 64; ! waddch(win->x_win, cch); ! } else ! waddch(win->x_win, (unsigned char)*text); getyx(win->x_win, win->x_line, win->x_col); text++; } --- 149,155 ---- text++; continue; } ! waddch(win->x_win, (unsigned char)*text); getyx(win->x_win, win->x_line, win->x_col); text++; } diff -cr talk/talk.c /usr/src/usr.bin/talk/talk.c *** talk/talk.c Tue Feb 27 20:35:30 2001 --- /usr/src/usr.bin/talk/talk.c Tue Feb 27 20:37:22 2001 *************** *** 46,52 **** #endif /* not lint */ #include "talk.h" - #include /* * talk: A visual form of write. Using sockets, a two way --- 46,51 ---- *************** *** 70,77 **** int argc; char *argv[]; { - (void) setlocale(LC_CTYPE, ""); - get_names(argc, argv); check_writeable(); init_display(); --- 69,74 ---- --2oS5YaxWCcQjTEyO-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message