util: look at STDOUT, not STDIN, when determining tty columns

https://bugzilla.redhat.com/show_bug.cgi?id=626891
This commit is contained in:
Lennart Poettering 2010-08-31 16:53:58 +02:00
parent dd6c17b159
commit 9ed95f4336

View file

@ -2988,7 +2988,7 @@ int columns(void) {
struct winsize ws;
zero(ws);
if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) >= 0)
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) >= 0)
parsed_columns = ws.ws_col;
}