diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2019-03-20 14:13:37 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2019-03-20 14:13:37 -0700 |
commit | 2e49103f09e72a1a0b6f100e36d3e9784bfce5c2 (patch) | |
tree | 159d10c60e8d982da7f13039868f004334f3613a | |
parent | 9188879adae14993110eb29f954174c3e796e998 (diff) |
418.56418.56
-rw-r--r-- | common-utils/msg.c | 18 | ||||
-rw-r--r-- | version.mk | 2 |
2 files changed, 13 insertions, 7 deletions
diff --git a/common-utils/msg.c b/common-utils/msg.c index 349c640..8a78530 100644 --- a/common-utils/msg.c +++ b/common-utils/msg.c @@ -20,6 +20,8 @@ * DEALINGS IN THE SOFTWARE. */ +#define _GNU_SOURCE // needed for fileno + #include <stdio.h> #include <stdarg.h> #include <stdlib.h> @@ -88,16 +90,20 @@ void reset_current_terminal_width(unsigned short new_val) static void format(FILE *stream, const char *prefix, const char *buf, const int whitespace) { - int i; - TextRows *t; + if (isatty(fileno(stream))) { + int i; + TextRows *t; - if (!__terminal_width) reset_current_terminal_width(0); + if (!__terminal_width) reset_current_terminal_width(0); - t = nv_format_text_rows(prefix, buf, __terminal_width, whitespace); + t = nv_format_text_rows(prefix, buf, __terminal_width, whitespace); - for (i = 0; i < t->n; i++) fprintf(stream, "%s\n", t->t[i]); + for (i = 0; i < t->n; i++) fprintf(stream, "%s\n", t->t[i]); - nv_free_text_rows(t); + nv_free_text_rows(t); + } else { + fprintf(stream, "%s%s\n", prefix ? prefix : "", buf); + } } @@ -1 +1 @@ -NVIDIA_VERSION = 418.43 +NVIDIA_VERSION = 418.56 |