chiark / gitweb /
util: look at STDOUT, not STDIN, when determining tty columns
authorLennart Poettering <lennart@poettering.net>
Tue, 31 Aug 2010 14:53:58 +0000 (16:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 31 Aug 2010 14:53:58 +0000 (16:53 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=626891

src/util.c

index a09b704..f982586 100644 (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;
         }