diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-11 16:35:52 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-11 16:35:52 +0100 |
commit | ed15dde60a72dce888df10295a916b199346929d (patch) | |
tree | e3d9fab96ea62f20f29460de32e8cacaab9d2267 /networking | |
parent | 6c1f348fa792a33d5a98e68c139df65c2d4c1628 (diff) | |
download | busybox-w32-ed15dde60a72dce888df10295a916b199346929d.tar.gz busybox-w32-ed15dde60a72dce888df10295a916b199346929d.tar.bz2 busybox-w32-ed15dde60a72dce888df10295a916b199346929d.zip |
Move FEATURE_AUTOWIDTH config option to two applets which use it
No code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r-- | networking/telnet.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/networking/telnet.c b/networking/telnet.c index f520fe1dd..a70f74762 100644 --- a/networking/telnet.c +++ b/networking/telnet.c | |||
@@ -45,6 +45,11 @@ | |||
45 | //config: remote host you are connecting to. This is useful when you need to | 45 | //config: remote host you are connecting to. This is useful when you need to |
46 | //config: log into a machine without telling the username (autologin). This | 46 | //config: log into a machine without telling the username (autologin). This |
47 | //config: option enables `-a' and `-l USER' arguments. | 47 | //config: option enables `-a' and `-l USER' arguments. |
48 | //config: | ||
49 | //config:config FEATURE_TELNET_WIDTH | ||
50 | //config: bool "Enable window size autodetection" | ||
51 | //config: default y | ||
52 | //config: depends on TELNET | ||
48 | 53 | ||
49 | //applet:IF_TELNET(APPLET(telnet, BB_DIR_USR_BIN, BB_SUID_DROP)) | 54 | //applet:IF_TELNET(APPLET(telnet, BB_DIR_USR_BIN, BB_SUID_DROP)) |
50 | 55 | ||
@@ -128,7 +133,7 @@ struct globals { | |||
128 | #if ENABLE_FEATURE_TELNET_AUTOLOGIN | 133 | #if ENABLE_FEATURE_TELNET_AUTOLOGIN |
129 | const char *autologin; | 134 | const char *autologin; |
130 | #endif | 135 | #endif |
131 | #if ENABLE_FEATURE_AUTOWIDTH | 136 | #if ENABLE_FEATURE_TELNET_WIDTH |
132 | unsigned win_width, win_height; | 137 | unsigned win_width, win_height; |
133 | #endif | 138 | #endif |
134 | /* same buffer used both for network and console read/write */ | 139 | /* same buffer used both for network and console read/write */ |
@@ -401,7 +406,7 @@ static void put_iac_subopt_autologin(void) | |||
401 | } | 406 | } |
402 | #endif | 407 | #endif |
403 | 408 | ||
404 | #if ENABLE_FEATURE_AUTOWIDTH | 409 | #if ENABLE_FEATURE_TELNET_WIDTH |
405 | static void put_iac_naws(byte c, int x, int y) | 410 | static void put_iac_naws(byte c, int x, int y) |
406 | { | 411 | { |
407 | if (G.iaclen + 9 > IACBUFSIZE) | 412 | if (G.iaclen + 9 > IACBUFSIZE) |
@@ -538,7 +543,7 @@ static void to_new_environ(void) | |||
538 | } | 543 | } |
539 | #endif | 544 | #endif |
540 | 545 | ||
541 | #if ENABLE_FEATURE_AUTOWIDTH | 546 | #if ENABLE_FEATURE_TELNET_WIDTH |
542 | static void to_naws(void) | 547 | static void to_naws(void) |
543 | { | 548 | { |
544 | /* Tell server we will do NAWS */ | 549 | /* Tell server we will do NAWS */ |
@@ -561,7 +566,7 @@ static void telopt(byte c) | |||
561 | case TELOPT_NEW_ENVIRON: | 566 | case TELOPT_NEW_ENVIRON: |
562 | to_new_environ(); break; | 567 | to_new_environ(); break; |
563 | #endif | 568 | #endif |
564 | #if ENABLE_FEATURE_AUTOWIDTH | 569 | #if ENABLE_FEATURE_TELNET_WIDTH |
565 | case TELOPT_NAWS: | 570 | case TELOPT_NAWS: |
566 | to_naws(); | 571 | to_naws(); |
567 | put_iac_naws(c, G.win_width, G.win_height); | 572 | put_iac_naws(c, G.win_width, G.win_height); |
@@ -623,7 +628,7 @@ int telnet_main(int argc UNUSED_PARAM, char **argv) | |||
623 | 628 | ||
624 | INIT_G(); | 629 | INIT_G(); |
625 | 630 | ||
626 | #if ENABLE_FEATURE_AUTOWIDTH | 631 | #if ENABLE_FEATURE_TELNET_WIDTH |
627 | get_terminal_width_height(0, &G.win_width, &G.win_height); | 632 | get_terminal_width_height(0, &G.win_width, &G.win_height); |
628 | #endif | 633 | #endif |
629 | 634 | ||