summaryrefslogtreecommitdiff
path: root/src/apk.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-04-22 11:13:32 +0300
committerTimo Teräs <timo.teras@iki.fi>2011-04-22 11:13:32 +0300
commit595c66595c549b7d595463cdfb932afe8d3c3540 (patch)
tree87de6a0b915e4c280f128a8bcd44477e90fce800 /src/apk.c
parentcec1fa2b0f414e980c4dc56a5cc4dc9ff48bddb8 (diff)
downloadapk-tools-595c66595c549b7d595463cdfb932afe8d3c3540.tar.gz
apk-tools-595c66595c549b7d595463cdfb932afe8d3c3540.tar.bz2
apk-tools-595c66595c549b7d595463cdfb932afe8d3c3540.tar.xz
apk-tools-595c66595c549b7d595463cdfb932afe8d3c3540.zip
apk: default screen width 70 if ioctl says 0 as width
Diffstat (limited to 'src/apk.c')
-rw-r--r--src/apk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/apk.c b/src/apk.c
index c40cc20..f0349e4 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -249,7 +249,7 @@ static void setup_terminal(void)
setvbuf(stderr, NULL, _IOLBF, BUFSIZ);
if (ioctl(STDERR_FILENO,TIOCGWINSZ, &w) == 0)
apk_screen_width = w.ws_col;
- else
+ if (apk_screen_width == 0)
apk_screen_width = 70;
if (isatty(STDOUT_FILENO) && isatty(STDERR_FILENO) && isatty(STDIN_FILENO))
apk_flags |= APK_PROGRESS;