aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2025-10-10 09:26:06 +0100
committerRon Yorston <rmy@pobox.com>2025-10-10 09:26:06 +0100
commit3681e397f60acc00a4389e3f8ba16d75889453c1 (patch)
treec7dca179504bfcab0341bcff689fe4eacc31159c /coreutils
parent0a97e79066de66d525129203da831ab81c66ce6e (diff)
downloadbusybox-w32-3681e397f60acc00a4389e3f8ba16d75889453c1.tar.gz
busybox-w32-3681e397f60acc00a4389e3f8ba16d75889453c1.tar.bz2
busybox-w32-3681e397f60acc00a4389e3f8ba16d75889453c1.zip
stty: drop 'rows' and 'columns' settingsFRP-5857-g3681e397f
Setting the console dimensions doesn't work reliably. Drop support for the 'rows' and 'columns' settings. Saves 752-768 bytes. (GitHub issue #58)
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/stty.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c
index 28eab86a6..c064ad90a 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -41,8 +41,7 @@
41//usage: "\n [SETTING] See manpage" 41//usage: "\n [SETTING] See manpage"
42//usage: ) 42//usage: )
43//usage: IF_PLATFORM_MINGW32( 43//usage: IF_PLATFORM_MINGW32(
44//usage: "\n [SETTING] [-]echo [-]cooked [-]raw sane" 44//usage: "\n [SETTING] [-]echo [-]cooked [-]raw sane size"
45//usage: "\n cols N rows N size"
46//usage: ) 45//usage: )
47 46
48/* If no args are given, write to stdout the baud rate and settings that 47/* If no args are given, write to stdout the baud rate and settings that
@@ -908,6 +907,7 @@ static void newline(void)
908 wrapf("\n"); 907 wrapf("\n");
909} 908}
910 909
910#if !ENABLE_PLATFORM_MINGW32
911#ifdef TIOCGWINSZ 911#ifdef TIOCGWINSZ
912static void set_window_size(int rows, int cols) 912static void set_window_size(int rows, int cols)
913{ 913{
@@ -930,6 +930,7 @@ bail:
930 perror_on_device("%s"); 930 perror_on_device("%s");
931} 931}
932#endif 932#endif
933#endif
933 934
934static void display_window_size(int fancy) 935static void display_window_size(int fancy)
935{ 936{
@@ -1468,11 +1469,13 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
1468#endif 1469#endif
1469 1470
1470 param = find_param(arg); 1471 param = find_param(arg);
1472#if !ENABLE_PLATFORM_MINGW32
1471 if (param & param_need_arg) { 1473 if (param & param_need_arg) {
1472 if (!argnext) 1474 if (!argnext)
1473 bb_error_msg_and_die(bb_msg_requires_arg, arg); 1475 bb_error_msg_and_die(bb_msg_requires_arg, arg);
1474 ++k; 1476 ++k;
1475 } 1477 }
1478#endif
1476 1479
1477 switch (param) { 1480 switch (param) {
1478#ifdef __linux__ 1481#ifdef __linux__
@@ -1566,7 +1569,9 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
1566 const struct control_info *cp; 1569 const struct control_info *cp;
1567#endif 1570#endif
1568 const char *arg = argv[k]; 1571 const char *arg = argv[k];
1572#if !ENABLE_PLATFORM_MINGW32
1569 const char *argnext = argv[k+1]; 1573 const char *argnext = argv[k+1];
1574#endif
1570 int param; 1575 int param;
1571 1576
1572 if (arg[0] == '-') { 1577 if (arg[0] == '-') {
@@ -1608,6 +1613,7 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
1608 stty_state |= STTY_require_set_attr; 1613 stty_state |= STTY_require_set_attr;
1609 break; 1614 break;
1610#endif 1615#endif
1616#if !ENABLE_PLATFORM_MINGW32
1611#ifdef TIOCGWINSZ 1617#ifdef TIOCGWINSZ
1612 case param_cols: 1618 case param_cols:
1613 case param_columns: 1619 case param_columns:
@@ -1620,7 +1626,6 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
1620 set_window_size(xatoul_sfx(argnext, stty_suffixes), -1); 1626 set_window_size(xatoul_sfx(argnext, stty_suffixes), -1);
1621 break; 1627 break;
1622#endif 1628#endif
1623#if !ENABLE_PLATFORM_MINGW32
1624 case param_speed: 1629 case param_speed:
1625 display_speed(&mode, 0); 1630 display_speed(&mode, 0);
1626 break; 1631 break;