diff options
author | 2019-06-13 12:51:56 +0200 | |
---|---|---|
committer | 2019-06-13 12:51:56 +0200 | |
commit | b4e37543f21958c5e5981c2b3694213d150d5bcd (patch) | |
tree | dd773df7243394550f6ae689fbe3859f817a55ff /qmanifest.c | |
parent | main/qmanifest: fix compilation on Linux (diff) | |
download | portage-utils-b4e37543f21958c5e5981c2b3694213d150d5bcd.tar.gz portage-utils-b4e37543f21958c5e5981c2b3694213d150d5bcd.tar.bz2 portage-utils-b4e37543f21958c5e5981c2b3694213d150d5bcd.zip |
main: disable word wrapping when stdout is not a terminal
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qmanifest.c')
-rw-r--r-- | qmanifest.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qmanifest.c b/qmanifest.c index 7ca2b40..21254c3 100644 --- a/qmanifest.c +++ b/qmanifest.c @@ -1505,7 +1505,7 @@ format_line(const char *pfx, const char *msg) if (*pfx == '-') { fprintf(stdout, "%s%s%s%s\n", pfx, RED, msg, NORM); } else { - if (!verbose && msglen > (size_t)twidth) { + if (!verbose && twidth > 0 && msglen > (size_t)twidth) { int to_remove = 3 + (msglen - twidth); int first_half = msglen / 2 - to_remove / 2; int remainder = msglen / 2 + (to_remove + 1) / 2; |