From f2ccb1b5f0ad814c1e6fcbc8f1ecaa62913b7e53 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 26 Aug 2007 18:26:29 +0000 Subject: [PATCH] Send error message to non-screen output devices also, if routing to listing files is enabled. Bug #17238. Thanks to John Darrington for review. * command/aggregate.sh: Update output to include error messages, which are now sent to output files also. * devices: Change raw-ascii from screen to listing device (because that's how it's used). --- config/ChangeLog | 5 +++++ config/devices | 2 +- src/ui/terminal/ChangeLog | 6 ++++++ src/ui/terminal/msg-ui.c | 12 ++++++++++++ tests/ChangeLog | 7 +++++++ tests/command/aggregate.sh | 10 +++++++++- tests/command/rank.sh | 7 +++++++ 7 files changed, 47 insertions(+), 2 deletions(-) diff --git a/config/ChangeLog b/config/ChangeLog index b865ad2d08..93c9e80967 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2007-08-26 Ben Pfaff + + * devices: Change raw-ascii from screen to listing device (because + that's how it's used). + 2007-07-25 Ben Pfaff * devices: Add tty and listing devices that use VT100 (and xterm) diff --git a/config/devices b/config/devices index 32d51befd6..7da8eac81a 100644 --- a/config/devices +++ b/config/devices @@ -53,7 +53,7 @@ tty-ascii:ascii:screen:squeeze=on headers=off top-margin=0 bottom-margin=0 \ paginate=off length=${viewlength} width=${viewwidth} \ output-file=${tty-output-file} list-ascii:ascii:listing:length=66 width=79 output-file=${list-output-file} -raw-ascii:ascii:screen:width=9999 length=9999 output-file=${list-output-file} \ +raw-ascii:ascii:listing:width=9999 length=9999 output-file=${list-output-file} \ emphasis=none headers=off paginate=off squeeze=on \ top-margin=0 bottom-margin=0 diff --git a/src/ui/terminal/ChangeLog b/src/ui/terminal/ChangeLog index 079aee789c..b3063bd281 100644 --- a/src/ui/terminal/ChangeLog +++ b/src/ui/terminal/ChangeLog @@ -1,3 +1,9 @@ +2007-08-26 Ben Pfaff + + * msg-ui.c (handle_msg): Send error message to non-screen output + devices also, if routing to listing files is enabled. Bug + #17238. Thanks to John Darrington for review. + 2007-08-23 Ben Pfaff Implement journaling. Bug #17240. diff --git a/src/ui/terminal/msg-ui.c b/src/ui/terminal/msg-ui.c index b51a3e5570..93c3683f22 100644 --- a/src/ui/terminal/msg-ui.c +++ b/src/ui/terminal/msg-ui.c @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include #include @@ -177,6 +179,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); } diff --git a/tests/ChangeLog b/tests/ChangeLog index dc2c7f983c..6c378de604 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,10 @@ +2007-08-26 Ben Pfaff + + * command/aggregate.sh: Update output to include error messages, + which are now sent to output files also. + + * command/ranks.h: Ditto. + 2007-08-12 Ben Pfaff * command/no_case_size.sh: Update to match update DISPLAY and diff --git a/tests/command/aggregate.sh b/tests/command/aggregate.sh index 3cdd84dbe7..b95401818a 100755 --- a/tests/command/aggregate.sh +++ b/tests/command/aggregate.sh @@ -150,6 +150,10 @@ EOF activity="expected output (itemwise missing) create" cat > agg-itemwise.out < agg-columnwise.out <