Move FEATURE_AUTOWIDTH config option to two applets which use it
No binary (build failed)
—
(log yok)
| @@ -50,17 +50,6 @@ config USE_PORTABLE_CODE | |
| compiler other than gcc. | |
| If you do use gcc, this option may needlessly increase code size. | |
| - | #fixme: delete, create suboptions for applets which use this |
| - | config FEATURE_AUTOWIDTH |
| - | bool "Calculate terminal & column widths" |
| - | default y |
| - | help |
| - | This option allows utilities such as 'ls', 'telnet' etc |
| - | to determine the width of the screen, which can allow them to |
| - | display additional text or avoid wrapping text onto the next line. |
| - | If you leave this disabled, your utilities will be especially |
| - | primitive and will be unable to determine the current screen width. |
| - | |
| config SHOW_USAGE | |
| bool "Show applet usage messages" | |
| default y | |
| @@ -265,11 +265,6 @@ CONFIG_YES=y | |
| # | |
| CONFIG_FEATURE_PRESERVE_HARDLINKS=y | |
| - | # |
| - | # Common options for ls, more and telnet |
| - | # |
| - | CONFIG_FEATURE_AUTOWIDTH=y |
| - | |
| # | |
| # Common options for df, du, ls | |
| # | |
| @@ -277,7 +277,6 @@ CONFIG_TRUE=y | |
| # CONFIG_WHOAMI is not set | |
| # CONFIG_YES is not set | |
| # CONFIG_FEATURE_PRESERVE_HARDLINKS is not set | |
| - | # CONFIG_FEATURE_AUTOWIDTH is not set |
| # CONFIG_FEATURE_HUMAN_READABLE is not set | |
| # CONFIG_FEATURE_MD5_SHA1_SUM_CHECK is not set | |
| @@ -276,11 +276,6 @@ CONFIG_YES=y | |
| # | |
| CONFIG_FEATURE_PRESERVE_HARDLINKS=y | |
| - | # |
| - | # Common options for ls, more and telnet |
| - | # |
| - | CONFIG_FEATURE_AUTOWIDTH=y |
| - | |
| # | |
| # Common options for df, du, ls | |
| # | |
| @@ -288,11 +288,6 @@ CONFIG_YES=y | |
| # | |
| CONFIG_FEATURE_PRESERVE_HARDLINKS=y | |
| - | # |
| - | # Common options for ls, more and telnet |
| - | # |
| - | CONFIG_FEATURE_AUTOWIDTH=y |
| - | |
| # | |
| # Common options for df, du, ls | |
| # | |
| @@ -389,11 +389,6 @@ CONFIG_FEATURE_VERBOSE=y | |
| # | |
| CONFIG_FEATURE_PRESERVE_HARDLINKS=y | |
| - | # |
| - | # Common options for ls, more and telnet |
| - | # |
| - | CONFIG_FEATURE_AUTOWIDTH=y |
| - | |
| # | |
| # Common options for df, du, ls | |
| # | |
| @@ -311,11 +311,6 @@ CONFIG_YES=y | |
| # | |
| CONFIG_FEATURE_PRESERVE_HARDLINKS=y | |
| - | # |
| - | # Common options for ls, more and telnet |
| - | # |
| - | CONFIG_FEATURE_AUTOWIDTH=y |
| - | |
| # | |
| # Common options for df, du, ls | |
| # | |
| @@ -315,11 +315,6 @@ CONFIG_FEATURE_VERBOSE=y | |
| # | |
| CONFIG_FEATURE_PRESERVE_HARDLINKS=y | |
| - | # |
| - | # Common options for ls, more and telnet |
| - | # |
| - | CONFIG_FEATURE_AUTOWIDTH=y |
| - | |
| # | |
| # Common options for df, du, ls | |
| # | |
| @@ -288,11 +288,6 @@ CONFIG_YES=y | |
| # | |
| CONFIG_FEATURE_PRESERVE_HARDLINKS=y | |
| - | # |
| - | # Common options for ls, more and telnet |
| - | # |
| - | CONFIG_FEATURE_AUTOWIDTH=y |
| - | |
| # | |
| # Common options for df, du, ls | |
| # | |
| @@ -286,11 +286,6 @@ CONFIG_YES=y | |
| # | |
| CONFIG_FEATURE_PRESERVE_HARDLINKS=y | |
| - | # |
| - | # Common options for ls, more and telnet |
| - | # |
| - | CONFIG_FEATURE_AUTOWIDTH=y |
| - | |
| # | |
| # Common options for df, du, ls | |
| # | |
| @@ -48,6 +48,11 @@ | |
| //config: default y | |
| //config: depends on LS | |
| //config: | |
| + | //config:config FEATURE_LS_WIDTH |
| + | //config: bool "Enable -w WIDTH and window size autodetection" |
| + | //config: default y |
| + | //config: depends on LS |
| + | //config: |
| //config:config FEATURE_LS_SORTFILES | |
| //config: bool "Sort the file names" | |
| //config: default y | |
| @@ -101,7 +106,7 @@ | |
| //usage: IF_FEATURE_LS_SORTFILES("rSXv") | |
| //usage: IF_FEATURE_LS_TIMESTAMPS("ctu") | |
| //usage: IF_SELINUX("kKZ") "]" | |
| - | //usage: IF_FEATURE_AUTOWIDTH(" [-w WIDTH]") " [FILE]..." |
| + | //usage: IF_FEATURE_LS_WIDTH(" [-w WIDTH]") " [FILE]..." |
| //usage:#define ls_full_usage "\n\n" | |
| //usage: "List directory contents\n" | |
| //usage: "\n -1 One column output" | |
| @@ -147,7 +152,7 @@ | |
| //usage: "\n -K List security context in long format" | |
| //usage: "\n -Z List security context and permission" | |
| //usage: ) | |
| - | //usage: IF_FEATURE_AUTOWIDTH( |
| + | //usage: IF_FEATURE_LS_WIDTH( |
| //usage: "\n -w N Assume the terminal is N columns wide" | |
| //usage: ) | |
| //usage: IF_FEATURE_LS_COLOR( | |
| @@ -263,7 +268,7 @@ static const char ls_options[] ALIGN1 = | |
| IF_SELINUX("KZ") /* 2, 26 */ | |
| IF_FEATURE_LS_FOLLOWLINKS("LH") /* 2, 28 */ | |
| IF_FEATURE_HUMAN_READABLE("h") /* 1, 29 */ | |
| - | IF_FEATURE_AUTOWIDTH("T:w:") /* 2, 31 */ |
| + | IF_FEATURE_LS_WIDTH("T:w:") /* 2, 31 */ |
| /* with --color, we use all 32 bits */; | |
| enum { | |
| //OPT_C = (1 << 0), | |
| @@ -298,7 +303,7 @@ enum { | |
| OPTBIT_h = OPTBIT_L + 2 * ENABLE_FEATURE_LS_FOLLOWLINKS, | |
| OPTBIT_T = OPTBIT_h + 1 * ENABLE_FEATURE_HUMAN_READABLE, | |
| OPTBIT_w, /* 30 */ | |
| - | OPTBIT_color = OPTBIT_T + 2 * ENABLE_FEATURE_AUTOWIDTH, |
| + | OPTBIT_color = OPTBIT_T + 2 * ENABLE_FEATURE_LS_WIDTH, |
| OPT_c = (1 << OPTBIT_c) * ENABLE_FEATURE_LS_TIMESTAMPS, | |
| OPT_e = (1 << OPTBIT_e) * ENABLE_FEATURE_LS_TIMESTAMPS, | |
| @@ -316,8 +321,8 @@ enum { | |
| OPT_L = (1 << OPTBIT_L) * ENABLE_FEATURE_LS_FOLLOWLINKS, | |
| OPT_H = (1 << OPTBIT_H) * ENABLE_FEATURE_LS_FOLLOWLINKS, | |
| OPT_h = (1 << OPTBIT_h) * ENABLE_FEATURE_HUMAN_READABLE, | |
| - | OPT_T = (1 << OPTBIT_T) * ENABLE_FEATURE_AUTOWIDTH, |
| - | OPT_w = (1 << OPTBIT_w) * ENABLE_FEATURE_AUTOWIDTH, |
| + | OPT_T = (1 << OPTBIT_T) * ENABLE_FEATURE_LS_WIDTH, |
| + | OPT_w = (1 << OPTBIT_w) * ENABLE_FEATURE_LS_WIDTH, |
| OPT_color = (1 << OPTBIT_color) * ENABLE_FEATURE_LS_COLOR, | |
| }; | |
| @@ -417,7 +422,7 @@ struct globals { | |
| #endif | |
| smallint exit_code; | |
| unsigned all_fmt; | |
| - | #if ENABLE_FEATURE_AUTOWIDTH |
| + | #if ENABLE_FEATURE_LS_WIDTH |
| unsigned terminal_width; | |
| # define G_terminal_width (G.terminal_width) | |
| #else | |
| @@ -433,7 +438,7 @@ struct globals { | |
| setup_common_bufsiz(); \ | |
| /* we have to zero it out because of NOEXEC */ \ | |
| memset(&G, 0, sizeof(G)); \ | |
| - | IF_FEATURE_AUTOWIDTH(G_terminal_width = TERMINAL_WIDTH;) \ |
| + | IF_FEATURE_LS_WIDTH(G_terminal_width = TERMINAL_WIDTH;) \ |
| IF_FEATURE_LS_TIMESTAMPS(time(&G.current_time_t);) \ | |
| } while (0) | |
| @@ -1167,7 +1172,7 @@ int ls_main(int argc UNUSED_PARAM, char **argv) | |
| if (ENABLE_FEATURE_LS_SORTFILES) | |
| G.all_fmt = SORT_NAME; | |
| - | #if ENABLE_FEATURE_AUTOWIDTH |
| + | #if ENABLE_FEATURE_LS_WIDTH |
| /* obtain the terminal width */ | |
| G_terminal_width = get_terminal_width(STDIN_FILENO); | |
| /* go one less... */ | |
| @@ -1190,9 +1195,9 @@ int ls_main(int argc UNUSED_PARAM, char **argv) | |
| ":x-1:1-x" /* bylines/oneline (not in SuS, but in GNU coreutils 8.4) */ | |
| IF_FEATURE_LS_TIMESTAMPS(":c-u:u-c") /* mtime/atime */ | |
| /* -w NUM: */ | |
| - | IF_FEATURE_AUTOWIDTH(":w+"); |
| + | IF_FEATURE_LS_WIDTH(":w+"); |
| opt = getopt32(argv, ls_options | |
| - | IF_FEATURE_AUTOWIDTH(, NULL, &G_terminal_width) |
| + | IF_FEATURE_LS_WIDTH(, NULL, &G_terminal_width) |
| IF_FEATURE_LS_COLOR(, &color_opt) | |
| ); | |
| for (i = 0; opt_flags[i] != (1U << 31); i++) { | |
| @@ -45,6 +45,11 @@ | |
| //config: remote host you are connecting to. This is useful when you need to | |
| //config: log into a machine without telling the username (autologin). This | |
| //config: option enables `-a' and `-l USER' arguments. | |
| + | //config: |
| + | //config:config FEATURE_TELNET_WIDTH |
| + | //config: bool "Enable window size autodetection" |
| + | //config: default y |
| + | //config: depends on TELNET |
| //applet:IF_TELNET(APPLET(telnet, BB_DIR_USR_BIN, BB_SUID_DROP)) | |
| @@ -128,7 +133,7 @@ struct globals { | |
| #if ENABLE_FEATURE_TELNET_AUTOLOGIN | |
| const char *autologin; | |
| #endif | |
| - | #if ENABLE_FEATURE_AUTOWIDTH |
| + | #if ENABLE_FEATURE_TELNET_WIDTH |
| unsigned win_width, win_height; | |
| #endif | |
| /* same buffer used both for network and console read/write */ | |
| @@ -401,7 +406,7 @@ static void put_iac_subopt_autologin(void) | |
| } | |
| #endif | |
| - | #if ENABLE_FEATURE_AUTOWIDTH |
| + | #if ENABLE_FEATURE_TELNET_WIDTH |
| static void put_iac_naws(byte c, int x, int y) | |
| { | |
| if (G.iaclen + 9 > IACBUFSIZE) | |
| @@ -538,7 +543,7 @@ static void to_new_environ(void) | |
| } | |
| #endif | |
| - | #if ENABLE_FEATURE_AUTOWIDTH |
| + | #if ENABLE_FEATURE_TELNET_WIDTH |
| static void to_naws(void) | |
| { | |
| /* Tell server we will do NAWS */ | |
| @@ -561,7 +566,7 @@ static void telopt(byte c) | |
| case TELOPT_NEW_ENVIRON: | |
| to_new_environ(); break; | |
| #endif | |
| - | #if ENABLE_FEATURE_AUTOWIDTH |
| + | #if ENABLE_FEATURE_TELNET_WIDTH |
| case TELOPT_NAWS: | |
| to_naws(); | |
| put_iac_naws(c, G.win_width, G.win_height); | |
| @@ -623,7 +628,7 @@ int telnet_main(int argc UNUSED_PARAM, char **argv) | |
| INIT_G(); | |
| - | #if ENABLE_FEATURE_AUTOWIDTH |
| + | #if ENABLE_FEATURE_TELNET_WIDTH |
| get_terminal_width_height(0, &G.win_width, &G.win_height); | |
| #endif | |