aboutsummaryrefslogtreecommitdiff
path: root/libbb/progress.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/progress.c')
-rw-r--r--libbb/progress.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/libbb/progress.c b/libbb/progress.c
index 372feb0c2..6154dca17 100644
--- a/libbb/progress.c
+++ b/libbb/progress.c
@@ -45,13 +45,6 @@ enum {
45 STALLTIME = 5 45 STALLTIME = 5
46}; 46};
47 47
48static unsigned int get_tty2_width(void)
49{
50 unsigned width;
51 get_terminal_width_height(2, &width, NULL);
52 return width;
53}
54
55void FAST_FUNC bb_progress_init(bb_progress_t *p, const char *curfile) 48void FAST_FUNC bb_progress_init(bb_progress_t *p, const char *curfile)
56{ 49{
57#if ENABLE_UNICODE_SUPPORT 50#if ENABLE_UNICODE_SUPPORT
@@ -148,7 +141,7 @@ void FAST_FUNC bb_progress_update(bb_progress_t *p,
148 unsigned ratio = 100 * beg_and_transferred / totalsize; 141 unsigned ratio = 100 * beg_and_transferred / totalsize;
149 fprintf(stderr, "%4u%%", ratio); 142 fprintf(stderr, "%4u%%", ratio);
150 143
151 barlength = get_tty2_width() - 49; 144 barlength = get_terminal_width(2) - 49;
152 if (barlength > 0) { 145 if (barlength > 0) {
153 /* god bless gcc for variable arrays :) */ 146 /* god bless gcc for variable arrays :) */
154 char buf[barlength + 1]; 147 char buf[barlength + 1];