summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1999-03-23 17:00:38 +0000
committermillert <millert@openbsd.org>1999-03-23 17:00:38 +0000
commite770ce936a80d50ce04f0b0e268fd23b0ef4d499 (patch)
tree289421410da08a647813237e7f56d59c823790fb
parentAdd DOSMBR_SIGNATURE_OFF define, needed for last disklabel change (diff)
downloadwireguard-openbsd-e770ce936a80d50ce04f0b0e268fd23b0ef4d499.tar.xz
wireguard-openbsd-e770ce936a80d50ce04f0b0e268fd23b0ef4d499.zip
Don't bother calling nl() in init_display, just do the '\r' -> '\n' conversion
ourselves in display(). Since we don't use the curses input routines we have to do the conversion by hand. This is cheap because input processing is done on a per-character basis. Closes PR 783.
-rw-r--r--usr.bin/talk/display.c12
-rw-r--r--usr.bin/talk/init_disp.c5
2 files changed, 11 insertions, 6 deletions
diff --git a/usr.bin/talk/display.c b/usr.bin/talk/display.c
index 52318e5e4bb..672b3b80cb9 100644
--- a/usr.bin/talk/display.c
+++ b/usr.bin/talk/display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: display.c,v 1.5 1998/04/28 22:13:22 pjanzen Exp $ */
+/* $OpenBSD: display.c,v 1.6 1999/03/23 17:00:38 millert Exp $ */
/* $NetBSD: display.c,v 1.3 1994/12/09 02:14:13 jtc Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)display.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: display.c,v 1.5 1998/04/28 22:13:22 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: display.c,v 1.6 1999/03/23 17:00:38 millert Exp $";
#endif /* not lint */
/*
@@ -80,7 +80,13 @@ display(win, text, size)
char cch;
for (i = 0; i < size; i++) {
- if (*text == '\n' || *text == '\r') {
+ /*
+ * Since we do not use curses's input routines we must
+ * convert '\r' -> '\n' ourselves.
+ */
+ if (*text == '\r')
+ *text = '\n';
+ if (*text == '\n') {
xscroll(win, 0);
text++;
continue;
diff --git a/usr.bin/talk/init_disp.c b/usr.bin/talk/init_disp.c
index aeb4d4ac5ca..75fe1286b92 100644
--- a/usr.bin/talk/init_disp.c
+++ b/usr.bin/talk/init_disp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_disp.c,v 1.9 1999/03/23 02:19:32 millert Exp $ */
+/* $OpenBSD: init_disp.c,v 1.10 1999/03/23 17:00:38 millert Exp $ */
/* $NetBSD: init_disp.c,v 1.6 1994/12/09 02:14:17 jtc Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)init_disp.c 8.2 (Berkeley) 2/16/94";
#endif
-static char rcsid[] = "$OpenBSD: init_disp.c,v 1.9 1999/03/23 02:19:32 millert Exp $";
+static char rcsid[] = "$OpenBSD: init_disp.c,v 1.10 1999/03/23 17:00:38 millert Exp $";
#endif /* not lint */
/*
@@ -73,7 +73,6 @@ init_display()
refresh();
noecho();
cbreak();
- nl();
signal(SIGINT, sig_sent);
signal(SIGPIPE, sig_sent);
/* curses takes care of ^Z */