Added #include "localcharset.h" to correspond to recent gnulib changes.
[pspp] / src / ui / terminal / msg-ui.c
index b51a3e557021fe26f042ed3e610a4981a315fb3f..173f60a7fa282e5dee213fb0211eb5cd7582ab63 100644 (file)
@@ -19,6 +19,7 @@
 #include "msg-ui.h"
 
 #include "linebreak.h"
+#include "localcharset.h"
 
 #include <libpspp/msg-locator.h>
 #include <libpspp/getl.h>
@@ -26,6 +27,8 @@
 #include <libpspp/message.h>
 #include <libpspp/str.h>
 #include <output/journal.h>
+#include <output/output.h>
+#include <output/table.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -177,6 +180,16 @@ handle_msg (const struct msg *m)
 
   dump_message (ds_cstr (&string), 78, 0, write_journal, NULL);
 
+  if (get_error_routing_to_listing ())
+    {
+      /* Disable screen output devices, because the error should
+         already have been reported to the screen with the
+         dump_message call above. */
+      outp_enable_device (false, OUTP_DEV_SCREEN);
+      tab_output_text (TAB_LEFT, ds_cstr (&string));
+      outp_enable_device (true, OUTP_DEV_SCREEN);
+    }
+
   ds_destroy (&string);
 }