Am 23.02.19 15:56 schrieb(en) Albrecht Dreß:
The attached patch replaces the hand-coded conversion by utilising g_convert(), and also fixes the bug.
I noticed only now that the patch contains a redundant assignment in imap_mailbox_to_utf8(), line 168 – doesn't do any harm (and will probably removed by the optimiser), but clutters the code. Additional fix, on top of the 1st attempt, attached… Sorry, Albrecht.
diff --git a/libbalsa/imap/util.c b/libbalsa/imap/util.c
index bb29575f9..b2809f223 100644
--- a/libbalsa/imap/util.c
+++ b/libbalsa/imap/util.c
@@ -165,7 +165,6 @@ imap_mailbox_to_utf8(const gchar *mbox)
utf7buf = g_malloc0(strlen(next_in) + 1U);
utf7buf[0] = '+'; /* RFC 2152 shift
character */
next_in++;
- next_utf7 = &utf7buf[1];
for (next_utf7 = &utf7buf[1]; (*next_in != '\0') && (*next_in != '-');
next_in++) {
if (*next_in == ',') { /* see RFC 3501, Section
5.1.3 */
*next_utf7++ = '/';
Attachment:
pgpOmJ9Tmyyp4.pgp
Description: PGP signature