Patch #6210. Reviewed by John Darrington.
[pspp-builds.git] / src / ui / terminal / msg-ui.c
index 173f60a7fa282e5dee213fb0211eb5cd7582ab63..98f99c1c71cd8dae6002cef7eb7624403e24fc5d 100644 (file)
@@ -32,6 +32,7 @@
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -175,7 +176,8 @@ handle_msg (const struct msg *m)
   ds_put_cstr (&string, m->text);
 
   if (msg_file != stdout || get_error_routing_to_terminal ())
-    dump_message (ds_cstr (&string), get_viewwidth (), 8,
+    dump_message (ds_cstr (&string),
+                  isatty (fileno (msg_file)) ? get_viewwidth () : INT_MAX, 8,
                   write_stream, msg_file);
 
   dump_message (ds_cstr (&string), 78, 0, write_journal, NULL);