summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2016-03-30 13:16:20 -0700
committerKevin McCarthy <kevin@8t8.us>2016-03-30 13:16:20 -0700
commitc9f060b776830f16856d53d1141ae37da5befc60 (patch)
tree39c004b0e369de4dcac803f241b2e4e521fcdad5
parente8c22ade073b2d5b886756f39d0ea415dfbd615d (diff)
Filter out bidi marks in rfc2047 and rfc2231 encoding. (see #3827)
Filter out U+200F RIGHT-TO-LEFT MARK and U+200E LEFT-TO-RIGHT MARK in rfc2047 and 2231 encoded fields. GNU Screen has a bug that corrupts the display, and can cause the wrong email to appear to be selected in the index. Until screen fixes the issue, filter it out in mutt.
-rw-r--r--mbyte.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mbyte.c b/mbyte.c
index fb96a714..470686c9 100644
--- a/mbyte.c
+++ b/mbyte.c
@@ -548,6 +548,14 @@ int mutt_filter_unprintable (char **s)
}
if (!IsWPrint (wc))
wc = '?';
+ /* HACK:
+ * Work around a gnu screen bug. See ticket #3827.
+ * Filter out the RIGHT-TO-LEFT and LEFT-TO-RIGHT bidi marks because
+ * they result in screen corruption.
+ */
+ else if (Charset_is_utf8 &&
+ ((wc == (wchar_t)0x200f) || (wc == (wchar_t)0x200e)))
+ wc = '?';
k2 = wcrtomb (scratch, wc, &mbstate2);
scratch[k2] = '\0';
mutt_buffer_addstr (b, scratch);