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
#
CONFIG_FEATURE_PRESERVE_HARDLINKS=y
-#
-# Common options for ls, more and telnet
-#
-CONFIG_FEATURE_AUTOWIDTH=y
-
#
# Common options for df, du, ls
#
# 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
#
CONFIG_FEATURE_PRESERVE_HARDLINKS=y
-#
-# Common options for ls, more and telnet
-#
-CONFIG_FEATURE_AUTOWIDTH=y
-
#
# Common options for df, du, ls
#
#
CONFIG_FEATURE_PRESERVE_HARDLINKS=y
-#
-# Common options for ls, more and telnet
-#
-CONFIG_FEATURE_AUTOWIDTH=y
-
#
# Common options for df, du, ls
#
#
CONFIG_FEATURE_PRESERVE_HARDLINKS=y
-#
-# Common options for ls, more and telnet
-#
-CONFIG_FEATURE_AUTOWIDTH=y
-
#
# Common options for df, du, ls
#
#
CONFIG_FEATURE_PRESERVE_HARDLINKS=y
-#
-# Common options for ls, more and telnet
-#
-CONFIG_FEATURE_AUTOWIDTH=y
-
#
# Common options for df, du, ls
#
#
CONFIG_FEATURE_PRESERVE_HARDLINKS=y
-#
-# Common options for ls, more and telnet
-#
-CONFIG_FEATURE_AUTOWIDTH=y
-
#
# Common options for df, du, ls
#
#
CONFIG_FEATURE_PRESERVE_HARDLINKS=y
-#
-# Common options for ls, more and telnet
-#
-CONFIG_FEATURE_AUTOWIDTH=y
-
#
# Common options for df, du, ls
#
#
CONFIG_FEATURE_PRESERVE_HARDLINKS=y
-#
-# Common options for ls, more and telnet
-#
-CONFIG_FEATURE_AUTOWIDTH=y
-
#
# Common options for df, du, ls
#
//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
//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"
//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(
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),
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,
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,
};
#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
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)
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... */
":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++) {
//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))
#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 */
}
#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)
}
#endif
-#if ENABLE_FEATURE_AUTOWIDTH
+#if ENABLE_FEATURE_TELNET_WIDTH
static void to_naws(void)
{
/* Tell server we will do NAWS */
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);
INIT_G();
-#if ENABLE_FEATURE_AUTOWIDTH
+#if ENABLE_FEATURE_TELNET_WIDTH
get_terminal_width_height(0, &G.win_width, &G.win_height);
#endif