summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2019-03-20 14:13:36 -0700
committerAaron Plattner <aplattner@nvidia.com>2019-03-20 14:13:36 -0700
commit6067f6c9a58a4447d3a17ec5ed8e3f60ff076d46 (patch)
tree32dfbadc827fab7d963a441046f6d7e034a3aceb
parent011f3feb08c37a8c4589c08a2532803fd5127284 (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