diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-10-10 15:41:12 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-10-10 15:41:12 +0000 |
commit | 32180c77f9e53db55782c1c3db409c2212983aee (patch) | |
tree | de605998ca6e4cb8f1c7831b55168ef9ead3c3f6 | |
parent | f84b251dcea2a027b2051fe9d1e8998cdde947da (diff) |
Use curses, not ocurses and thus setupterm() not tgetent(). This means
we no longer need to have a faked up telnet_setupterm().
Remove some unused variables and add missing err.h include in sys_bsd.c
-rw-r--r-- | usr.bin/telnet/Makefile | 10 | ||||
-rw-r--r-- | usr.bin/telnet/commands.c | 10 | ||||
-rw-r--r-- | usr.bin/telnet/sys_bsd.c | 3 | ||||
-rw-r--r-- | usr.bin/telnet/telnet.c | 37 |
4 files changed, 16 insertions, 44 deletions
diff --git a/usr.bin/telnet/Makefile b/usr.bin/telnet/Makefile index 984ffdb3b37..4e2da93249b 100644 --- a/usr.bin/telnet/Makefile +++ b/usr.bin/telnet/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.9 2000/09/03 18:41:20 espie Exp $ +# $OpenBSD: Makefile,v 1.10 2000/10/10 15:41:09 millert Exp $ # # Copyright (c) 1990 The Regents of the University of California. # All rights reserved. @@ -36,11 +36,10 @@ PROG= telnet -CFLAGS+=-DTERMCAP -DKLUDGELINEMODE -DUSE_TERMIO -DSKEY -Dunix -CFLAGS+=-DENV_HACK -D_USE_OLD_CURSES_ +CFLAGS+=-DKLUDGELINEMODE -DUSE_TERMIO -DENV_HACK -DSKEY -Dunix CFLAGS+=-I${.CURDIR}/../../lib -LDADD+= -locurses -ltelnet -DPADD= ${LIBOLDCURSES} ${LIBTELNET} +LDADD+= -lcurses -ltelnet +DPADD= ${LIBCURSES} ${LIBTELNET} SRCS= authenc.c commands.c main.c network.c ring.c sys_bsd.c telnet.c \ terminal.c tn3270.c utilities.c @@ -54,4 +53,3 @@ DPADD+= ${LIBDES} ${LIBKRB} .endif .include <bsd.prog.mk> - diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c index cf2323aca11..7324c0fb73b 100644 --- a/usr.bin/telnet/commands.c +++ b/usr.bin/telnet/commands.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commands.c,v 1.32 2000/08/13 19:41:13 itojun Exp $ */ +/* $OpenBSD: commands.c,v 1.33 2000/10/10 15:41:10 millert Exp $ */ /* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */ /* @@ -2270,14 +2270,7 @@ tn(argc, argv) { struct addrinfo hints, *res, *res0; int error; -#if defined(AF_INET6) - struct sockaddr_in6 sin6; -#endif struct sockaddr_in sin; - struct sockaddr_in ladr; - struct sockaddr *sa; - int sa_size; - struct servent *sp = 0; unsigned long temp; extern char *inet_ntoa(); #if defined(IP_OPTIONS) && defined(IPPROTO_IP) @@ -2285,7 +2278,6 @@ tn(argc, argv) int srlen; #endif char *cmd, *hostp = 0, *portp = 0, *user = 0, *aliasp = 0; - int family, port; int retry; #ifdef NI_WITHSCOPEID const int niflags = NI_NUMERICHOST | NI_WITHSCOPEID; diff --git a/usr.bin/telnet/sys_bsd.c b/usr.bin/telnet/sys_bsd.c index e10977c729f..ba105592dad 100644 --- a/usr.bin/telnet/sys_bsd.c +++ b/usr.bin/telnet/sys_bsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_bsd.c,v 1.7 1999/05/07 18:29:07 deraadt Exp $ */ +/* $OpenBSD: sys_bsd.c,v 1.8 2000/10/10 15:41:10 millert Exp $ */ /* $NetBSD: sys_bsd.c,v 1.11 1996/02/28 21:04:10 thorpej Exp $ */ /* @@ -35,6 +35,7 @@ */ #include "telnet_locl.h" +#include <err.h> /* * The following routines try to encapsulate what is system dependent diff --git a/usr.bin/telnet/telnet.c b/usr.bin/telnet/telnet.c index 0a3b80b20d7..fc0e69114e2 100644 --- a/usr.bin/telnet/telnet.c +++ b/usr.bin/telnet/telnet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: telnet.c,v 1.8 1999/12/30 16:58:22 itojun Exp $ */ +/* $OpenBSD: telnet.c,v 1.9 2000/10/10 15:41:11 millert Exp $ */ /* $NetBSD: telnet.c,v 1.7 1996/02/28 21:04:15 thorpej Exp $ */ /* @@ -35,6 +35,8 @@ */ #include "telnet_locl.h" +#include <curses.h> +#include <term.h> #define strip(x) (eight ? (x) : ((x) & 0x7f)) @@ -531,10 +533,9 @@ dontoption(option) } /* - * Given a buffer returned by tgetent(), this routine will turn - * the pipe seperated list of names in the buffer into an array - * of pointers to null terminated names. We toss out any bad, - * duplicate, or verbose names (names with spaces). + * This routine will turn a pipe seperated list of names in the buffer + * into an array of pointers to NUL terminated names. We toss out any + * bad, duplicate, or verbose names (names with spaces). */ int is_unique P((char *, char **, char **)); @@ -562,7 +563,7 @@ mklist(buf, name) /* * Count up the number of names. */ - for (n = 1, cp = buf; *cp && *cp != ':'; cp++) { + for (n = 1, cp = buf; *cp; cp++) { if (*cp == '|') n++; } @@ -668,25 +669,6 @@ is_unique(name, as, ae) return (1); } -static char termbuf[1024]; - - /*ARGSUSED*/ - int -telnet_setupterm(tname, fd, errp) - char *tname; - int fd, *errp; -{ - if (tgetent(termbuf, tname) == 1) { - termbuf[1023] = '\0'; - if (errp) - *errp = 1; - return(0); - } - if (errp) - *errp = 0; - return(-1); -} - int resettermname = 1; char * @@ -695,15 +677,14 @@ gettermname() char *tname; static char **tnamep = 0; static char **next; - int err; if (resettermname) { resettermname = 0; if (tnamep && tnamep != unknown) free(tnamep); if ((tname = (char *)env_getvalue((unsigned char *)"TERM")) && - (telnet_setupterm(tname, 1, &err) == 0)) { - tnamep = mklist(termbuf, tname); + (setupterm(tname, 1, NULL) == OK)) { + tnamep = mklist(ttytype, tname); } else { if (tname && ((int)strlen(tname) <= 40)) { unknown[0] = tname; |