summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko2015-10-23 01:44:22 +0200
committerDenys Vlasenko2015-10-23 01:44:22 +0200
commit641caaec3d495f3a92f652f12ab70b02ba9312ac (patch)
tree2a1aeb78c4344d1cd4423cdd96b581a797392b58 /coreutils
parenta96074874857b31361d02ead97a1152164568918 (diff)
downloadbusybox-641caaec3d495f3a92f652f12ab70b02ba9312ac.zip
busybox-641caaec3d495f3a92f652f12ab70b02ba9312ac.tar.gz
libbb: factor out code which queries screen width
function old new delta get_terminal_width - 17 +17 stty_main 1196 1197 +1 pstree_main 321 319 -2 ls_main 735 731 -4 watch_main 232 225 -7 bb_progress_update 714 706 -8 ps_main 555 543 -12 run_applet_and_exit 708 695 -13 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/6 up/down: 18/-46) Total: -28 byte Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/ls.c2
-rw-r--r--coreutils/stty.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 14c8bea..c484988 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -1105,7 +1105,7 @@ int ls_main(int argc UNUSED_PARAM, char **argv)
#if ENABLE_FEATURE_AUTOWIDTH
/* obtain the terminal width */
- get_terminal_width_height(STDIN_FILENO, &G_terminal_width, NULL);
+ G_terminal_width = get_terminal_width(STDIN_FILENO);
/* go one less... */
G_terminal_width--;
#endif
diff --git a/coreutils/stty.c b/coreutils/stty.c
index 378a848..b63b0b9 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -1403,7 +1403,7 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
perror_on_device_and_die("%s");
if (stty_state & (STTY_verbose_output | STTY_recoverable_output | STTY_noargs)) {
- get_terminal_width_height(STDOUT_FILENO, &G.max_col, NULL);
+ G.max_col = get_terminal_width(STDOUT_FILENO);
output_func(&mode, display_all);
return EXIT_SUCCESS;
}