From 0d16d021504a2249a49b620dfd328dd21ac2324d Mon Sep 17 00:00:00 2001 From: Eric Melville Date: Wed, 27 Nov 2002 06:34:24 +0000 Subject: [PATCH] Merge argument parsing changes into this copy of telnet. Submitted by: markm Approved by: bmah --- contrib/telnet/telnet/commands.c | 8 ++++++-- crypto/telnet/telnet/commands.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/contrib/telnet/telnet/commands.c b/contrib/telnet/telnet/commands.c index f0372a0a5856..c450f43cbc11 100644 --- a/contrib/telnet/telnet/commands.c +++ b/contrib/telnet/telnet/commands.c @@ -2284,8 +2284,12 @@ tn(int argc, char *argv[]) #endif (hostname = strrchr(hostp, ':')) == NULL) hostname = strrchr(hostp, '@'); - hostname++; - srcroute = 1; + if (hostname == NULL) { + hostname = hostp; + } else { + hostname++; + srcroute = 1; + } } else hostname = hostp; if (!portp) { diff --git a/crypto/telnet/telnet/commands.c b/crypto/telnet/telnet/commands.c index f0372a0a5856..c450f43cbc11 100644 --- a/crypto/telnet/telnet/commands.c +++ b/crypto/telnet/telnet/commands.c @@ -2284,8 +2284,12 @@ tn(int argc, char *argv[]) #endif (hostname = strrchr(hostp, ':')) == NULL) hostname = strrchr(hostp, '@'); - hostname++; - srcroute = 1; + if (hostname == NULL) { + hostname = hostp; + } else { + hostname++; + srcroute = 1; + } } else hostname = hostp; if (!portp) {