summaryrefslogtreecommitdiffstats
path: root/curs_lib.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-10-28 21:43:27 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-10-28 21:43:27 +0000
commit32b08b42f2eba83609bc838e383e077bbbf587fe (patch)
treef49c77b7e25edf9d8b033d28c828f484b4234767 /curs_lib.c
parent8ec77a5ca0ffa6915a08b99174d8b33af48500ff (diff)
Add an IsPrint check to mutt_message() and mutt_curses_error(). This
will prevent _some_ advert effects from l10ns which don't fit together with the terminal's abilities. There are still quite a few raw printw() etc. - we may wish to introduce our own, locale-safe versions of these.
Diffstat (limited to 'curs_lib.c')
-rw-r--r--curs_lib.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/curs_lib.c b/curs_lib.c
index 6b20d68f..00e6ceb1 100644
--- a/curs_lib.c
+++ b/curs_lib.c
@@ -182,6 +182,16 @@ void mutt_query_exit (void)
Signals &= ~S_INTERRUPT;
}
+static void clean_error_buf(void)
+{
+ char *s;
+ for(s = Errorbuf; *s; s++)
+ {
+ if(!IsPrint(*s))
+ *s = '.';
+ }
+}
+
void mutt_curses_error (const char *fmt, ...)
{
va_list ap;
@@ -192,6 +202,7 @@ void mutt_curses_error (const char *fmt, ...)
dprint (1, (debugfile, "%s\n", Errorbuf));
Errorbuf[ (COLS < sizeof (Errorbuf) ? COLS : sizeof (Errorbuf)) - 2 ] = 0;
+ clean_error_buf();
BEEP ();
SETCOLOR (MT_COLOR_ERROR);
@@ -212,6 +223,7 @@ void mutt_message (const char *fmt, ...)
va_end (ap);
Errorbuf[ (COLS < sizeof (Errorbuf) ? COLS : sizeof (Errorbuf)) - 2 ] = 0;
+ clean_error_buf();
SETCOLOR (MT_COLOR_MESSAGE);
mvaddstr (LINES - 1, 0, Errorbuf);