From 01c2dcaca75ce2850386cc5a40efb570f1fb1ad6 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 1 Aug 2012 07:47:40 +0200 Subject: [PATCH] xbps-bin: get_maxcols(): use stdin to make it work in all cases (from xdave). --- bin/xbps-bin/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/xbps-bin/util.c b/bin/xbps-bin/util.c index f9d73955..d449eb10 100644 --- a/bin/xbps-bin/util.c +++ b/bin/xbps-bin/util.c @@ -221,7 +221,7 @@ get_maxcols(void) { struct winsize ws; - if (ioctl(1, TIOCGWINSZ, &ws) == 0) + if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) == 0) return ws.ws_col; return 80;