dovecot-2.0: lib-storage: human search arg parser now gets mailb...

dovecot at dovecot.org dovecot at dovecot.org
Fri May 28 14:25:07 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/15cda53f4e79
changeset: 11408:15cda53f4e79
user:      Timo Sirainen <tss at iki.fi>
date:      Fri May 28 12:21:58 2010 +0100
description:
lib-storage: human search arg parser now gets mailbox name using UTF-8.

diffstat:

 src/lib-storage/mail-search-register-human.c |  16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r f9e5c73a988b -r 15cda53f4e79 src/lib-storage/mail-search-register-human.c
--- a/src/lib-storage/mail-search-register-human.c	Fri May 28 11:47:42 2010 +0100
+++ b/src/lib-storage/mail-search-register-human.c	Fri May 28 12:21:58 2010 +0100
@@ -3,6 +3,8 @@
 #include "lib.h"
 #include "ioloop.h"
 #include "array.h"
+#include "str.h"
+#include "imap-utf7.h"
 #include "settings-parser.h"
 #include "imap-date.h"
 #include "mail-search-register.h"
@@ -132,7 +134,19 @@
 static struct mail_search_arg *
 human_search_mailbox(struct mail_search_build_context *ctx)
 {
-	return mail_search_build_str(ctx, SEARCH_MAILBOX_GLOB);
+	struct mail_search_arg *sarg;
+
+	sarg = mail_search_build_str(ctx, SEARCH_MAILBOX_GLOB);
+	T_BEGIN {
+		string_t *str = t_str_new(128);
+
+		if (imap_utf8_to_utf7(sarg->value.str, str) < 0) {
+			str_truncate(str, 0);
+			str_append(str, sarg->value.str);
+		}
+		sarg->value.str = p_strdup(ctx->pool, str_c(str));
+	} T_END;
+	return sarg;
 }
 
 static struct mail_search_arg *


More information about the dovecot-cvs mailing list