summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2019-03-20 14:13:37 -0700
committerAaron Plattner <aplattner@nvidia.com>2019-03-20 14:13:37 -0700
commit2e49103f09e72a1a0b6f100e36d3e9784bfce5c2 (patch)
tree159d10c60e8d982da7f13039868f004334f3613a
parent9188879adae14993110eb29f954174c3e796e998 (diff)
418.56418.56
-rw-r--r--common-utils/msg.c18
-rw-r--r--version.mk2
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);
+ }
}
diff --git a/version.mk b/version.mk
index 33d731b..6942222 100644
--- a/version.mk
+++ b/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 418.43
+NVIDIA_VERSION = 418.56