diff options
author | Jan Niklas Hasse <jhasse@bixense.com> | 2018-11-05 23:51:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-05 23:51:28 (GMT) |
commit | cf51ff558f0fb5b736336182ff4f5df20ca3f8a4 (patch) | |
tree | 22c9935121d4313f71c7b15f094022c0e7beadc8 | |
parent | 19c294671c21b11b55f594c16aed372ee85dfd28 (diff) | |
parent | f56a83284495a2998e68797390d277ca94089aa2 (diff) | |
download | Ninja-cf51ff558f0fb5b736336182ff4f5df20ca3f8a4.zip Ninja-cf51ff558f0fb5b736336182ff4f5df20ca3f8a4.tar.gz Ninja-cf51ff558f0fb5b736336182ff4f5df20ca3f8a4.tar.bz2 |
Merge pull request #1473 from zdave/query-term-stdout
Query terminal width from STDOUT_FILENO
-rw-r--r-- | src/line_printer.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/line_printer.cc b/src/line_printer.cc index cfc1f19..a3a551e 100644 --- a/src/line_printer.cc +++ b/src/line_printer.cc @@ -83,7 +83,7 @@ void LinePrinter::Print(string to_print, LineType type) { // Limit output to width of the terminal if provided so we don't cause // line-wrapping. winsize size; - if ((ioctl(0, TIOCGWINSZ, &size) == 0) && size.ws_col) { + if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, &size) == 0) && size.ws_col) { to_print = ElideMiddle(to_print, size.ws_col); } printf("%s", to_print.c_str()); |