aboutsummaryrefslogtreecommitdiff
path: root/networking/telnet.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/telnet.c')
-rw-r--r--networking/telnet.c36
1 files changed, 5 insertions, 31 deletions
diff --git a/networking/telnet.c b/networking/telnet.c
index 24160057b..d9f0e94bc 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -8,19 +8,7 @@
8 * Created: Thu Apr 7 13:29:41 1994 too 8 * Created: Thu Apr 7 13:29:41 1994 too
9 * Last modified: Fri Jun 9 14:34:24 2000 too 9 * Last modified: Fri Jun 9 14:34:24 2000 too
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * 12 *
25 * HISTORY 13 * HISTORY
26 * Revision 3.1 1994/04/17 11:31:54 too 14 * Revision 3.1 1994/04/17 11:31:54 too
@@ -636,10 +624,6 @@ extern int telnet_main(int argc, char** argv)
636 int maxfd; 624 int maxfd;
637#endif 625#endif
638 626
639#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
640 int opt;
641#endif
642
643#ifdef CONFIG_FEATURE_AUTOWIDTH 627#ifdef CONFIG_FEATURE_AUTOWIDTH
644 get_terminal_width_height(0, &win_width, &win_height); 628 get_terminal_width_height(0, &win_width, &win_height);
645#endif 629#endif
@@ -661,20 +645,10 @@ extern int telnet_main(int argc, char** argv)
661 bb_show_usage(); 645 bb_show_usage();
662 646
663#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN 647#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
664 autologin = NULL; 648 unsigned long flags = bb_getopt_ulflags(argc, argv, "al:", &autologin);
665 while ((opt = getopt(argc, argv, "al:")) != EOF) { 649 if (flags & 1)
666 switch (opt) { 650 autologin = getenv("USER");
667 case 'l': 651
668 autologin = optarg;
669 break;
670 case 'a':
671 autologin = getenv("USER");
672 break;
673 case '?':
674 bb_show_usage();
675 break;
676 }
677 }
678 if (optind < argc) { 652 if (optind < argc) {
679 bb_lookup_host(&s_in, argv[optind++]); 653 bb_lookup_host(&s_in, argv[optind++]);
680 s_in.sin_port = bb_lookup_port((optind < argc) ? argv[optind++] : 654 s_in.sin_port = bb_lookup_port((optind < argc) ? argv[optind++] :