# HG changeset patch # User reimar # Date 1278835346 0 # Node ID 7c76f46056c9174b9552c81b3fb516ce35ece11f # Parent 40c30c70ead071765bcbbc224a9c11afc897b88f Avoid status line being mangled together with error messages and other output. Patch by Dan Oscarsson [Dan.Oscarsson tieto com] diff -r 40c30c70ead0 -r 7c76f46056c9 mp_msg.c --- a/mp_msg.c Sun Jul 11 07:37:02 2010 +0000 +++ b/mp_msg.c Sun Jul 11 08:02:26 2010 +0000 @@ -181,6 +181,8 @@ char tmp[MSGSIZE_MAX]; FILE *stream = lev <= MSGL_WARN ? stderr : stdout; static int header = 1; + // indicates if last line printed was a status line + static int statusline; size_t len; if (!mp_msg_test(mod, lev)) return; // do not display @@ -221,6 +223,11 @@ } #endif + // as a status line normally is intended to be overwitten by next status line + // output a '\n' to get a normal message on a separate line + if (statusline && lev != MSGL_STATUS) fprintf(stream, "\n"); + statusline = lev == MSGL_STATUS; + if (header) print_msg_module(stream, mod); set_msg_color(stream, lev);