diff options
Diffstat (limited to 'contrib/telnet/telnet/commands.c')
-rw-r--r-- | contrib/telnet/telnet/commands.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/contrib/telnet/telnet/commands.c b/contrib/telnet/telnet/commands.c index c52af2a81a67..ca3460e455ad 100644 --- a/contrib/telnet/telnet/commands.c +++ b/contrib/telnet/telnet/commands.c @@ -32,8 +32,6 @@ static const char sccsid[] = "@(#)commands.c 8.4 (Berkeley) 5/30/95"; #endif #endif -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/un.h> @@ -423,8 +421,7 @@ send_docmd(char *name) } static int -send_dontcmd(name) - char *name; +send_dontcmd(char *name) { return(send_tncmd(send_dont, "dont", name)); } @@ -939,7 +936,7 @@ setcmd(int argc, char *argv[]) } ct = getset(argv[1]); - if (ct == 0) { + if (ct == 0 || !(ct->name && ct->name[0] != ' ')) { c = GETTOGGLE(argv[1]); if (c == 0) { fprintf(stderr, "'%s': unknown argument ('set ?' for help).\n", @@ -1015,7 +1012,7 @@ unsetcmd(int argc, char *argv[]) while (argc--) { name = *argv++; ct = getset(name); - if (ct == 0) { + if (ct == 0 || !(ct->name && ct->name[0] != ' ')) { c = GETTOGGLE(name); if (c == 0) { fprintf(stderr, "'%s': unknown argument ('unset ?' for help).\n", @@ -2702,7 +2699,7 @@ help(int argc, char *argv[]) printf("?Ambiguous help command %s\n", arg); else if (c == (Command *)0) printf("?Invalid help command %s\n", arg); - else + else if (c->help) printf("%s\n", c->help); } return 0; |