summaryrefslogtreecommitdiffstats
path: root/usr.bin/talk
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2000-07-11 01:31:39 +0000
committerps <ps@FreeBSD.org>2000-07-11 01:31:39 +0000
commitbd64605db3215c4a53095aa5e1de7ae6ade5c18b (patch)
tree52b7b9d7eab00a2871dd3f0806a466a751c10743 /usr.bin/talk
parent305d74b0be54e5c2f063714cb8181f879c8bfd16 (diff)
downloadFreeBSD-src-bd64605db3215c4a53095aa5e1de7ae6ade5c18b.zip
FreeBSD-src-bd64605db3215c4a53095aa5e1de7ae6ade5c18b.tar.gz
Fix a bug when talking to non-freebsd machines where carriage return
was being interperated and displayed as ^M on the remote side. Old curses used to change the behavior of the tty and how carriage return was interperated via STDIN. ncurses does this on a per-window basis within the library rather than using the tty modes. Since talk is bypassing ncurses, it was missing the conversion. Reviewed by: peter
Diffstat (limited to 'usr.bin/talk')
-rw-r--r--usr.bin/talk/io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.bin/talk/io.c b/usr.bin/talk/io.c
index f7a4dd1..40604e0 100644
--- a/usr.bin/talk/io.c
+++ b/usr.bin/talk/io.c
@@ -103,10 +103,14 @@ talk()
* We can't make the tty non_blocking, because
* curses's output routines would screw up
*/
+ int i;
ioctl(0, FIONREAD, (struct sgttyb *) &nb);
nb = read(0, buf, nb);
display(&my_win, buf, nb);
/* might lose data here because sockt is non-blocking */
+ for (i = 0; i < nb; ++i)
+ if (buf[i] == '\r')
+ buf[i] = '\n';
write(sockt, buf, nb);
}
}
OpenPOWER on IntegriCloud