]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Use imap_append_astring() instead of imap_append_string() where possible.
authorTimo Sirainen <tss@iki.fi>
Wed, 24 Oct 2012 07:14:17 +0000 (10:14 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 24 Oct 2012 07:14:17 +0000 (10:14 +0300)
src/imap/cmd-list.c
src/imap/cmd-notify.c
src/imap/imap-fetch.c
src/imap/imap-notify.c
src/imap/imap-status.c
src/plugins/imap-acl/imap-acl-plugin.c
src/plugins/imap-quota/imap-quota-plugin.c

index fc18be2cb5f99888560c32e055048e96a9b53e41..8b754a51845c4546703080d9082cefdd0b638d09 100644 (file)
@@ -249,7 +249,7 @@ static bool cmd_list_continue(struct client_command_context *cmd)
                list_reply_append_ns_sep_param(str,
                        mail_namespace_get_sep(info->ns));
                str_append_c(str, ' ');
-               imap_append_string(str, str_c(mutf7_name));
+               imap_append_astring(str, str_c(mutf7_name));
                mailbox_childinfo2str(ctx, str, flags);
 
                ret = client_send_line_next(ctx->cmd->client, str_c(str));
@@ -333,7 +333,7 @@ static void cmd_list_ref_root(struct client *client, const char *ref)
        str_printfa(str, "%c\" ", ns_sep);
        if (*ns_prefix != '\0') {
                /* non-hidden namespace, use it as the root name */
-               imap_append_string(str, ns_prefix);
+               imap_append_astring(str, ns_prefix);
        } else {
                /* Hidden namespace or empty namespace prefix. We could just
                   return an empty root name, but it's safer to emulate what
@@ -344,7 +344,7 @@ static void cmd_list_ref_root(struct client *client, const char *ref)
                if (p == NULL)
                        str_append(str, "\"\"");
                else
-                       imap_append_string(str, t_strdup_until(ref, p + 1));
+                       imap_append_astring(str, t_strdup_until(ref, p + 1));
        }
        client_send_line(client, str_c(str));
 }
index f1f4b2ce99a925ae340c8d8d25dee35f08a94bcc..b92b95fc99909a814c6640a55c4523418f5214bf 100644 (file)
@@ -365,7 +365,7 @@ imap_notify_box_list_noperm(struct client *client, struct mailbox *box)
        str_append_c(str, ns_sep);
        str_append(str, "\" ");
 
-       imap_append_string(str, mailbox_get_vname(box));
+       imap_append_astring(str, mailbox_get_vname(box));
        client_send_line(client, str_c(str));
 }
 
index bb89c29fc3aef274ba5305df1cb5aec6e65b7ffa..ddcc3e03a0315b235e4a6640fab10915c552d6cd 100644 (file)
@@ -833,7 +833,7 @@ static int fetch_guid(struct imap_fetch_context *ctx, struct mail *mail,
                return -1;
 
        str_append(ctx->state.cur_str, "X-GUID ");
-       imap_append_string(ctx->state.cur_str, value);
+       imap_append_astring(ctx->state.cur_str, value);
        str_append_c(ctx->state.cur_str, ' ');
        return 1;
 }
@@ -860,7 +860,7 @@ static int fetch_x_mailbox(struct imap_fetch_context *ctx, struct mail *mail,
                i_panic("FETCH: Mailbox name not UTF-8: %s", name);
 
        str_append(ctx->state.cur_str, "X-MAILBOX ");
-       imap_append_string(ctx->state.cur_str, str_c(mutf7_name));
+       imap_append_astring(ctx->state.cur_str, str_c(mutf7_name));
        str_append_c(ctx->state.cur_str, ' ');
        return 1;
 }
index 9f4ae5618cbf743721fc2529bd7424afc97def98..5cd8601f9194e2ff82828ad902d94a2022779fa6 100644 (file)
@@ -33,10 +33,10 @@ static int imap_notify_list(struct imap_notify_namespace *notify_ns,
        str_append_c(str, ns_sep);
        str_append(str, "\" ");
 
-       imap_append_string(str, rec->vname);
+       imap_append_astring(str, rec->vname);
        if (rec->old_vname != NULL) {
                str_append(str, " (\"OLDNAME\" (");
-               imap_append_string(str, rec->old_vname);
+               imap_append_astring(str, rec->old_vname);
                str_append(str, "))");
        }
        return client_send_line_next(notify_ns->ctx->client, str_c(str));
index 1e8a173ae884b6f8517d83c1fbe8fd8a374f775f..e0e7625d01d087969efc746df9ee6e2790aa2ab2 100644 (file)
@@ -107,7 +107,7 @@ int imap_status_send(struct client *client, const char *mailbox_mutf7,
 
        str = t_str_new(128);
        str_append(str, "* STATUS ");
-        imap_append_string(str, mailbox_mutf7);
+        imap_append_astring(str, mailbox_mutf7);
        str_append(str, " (");
 
        prefix_len = str_len(str);
index 9408af9d6813def76a6162e622944a132c60f29d..990a856fc3fe4062106bec36cd694bf829e213fc 100644 (file)
@@ -163,7 +163,7 @@ imap_acl_write_right(string_t *dest, string_t *tmp,
                i_unreached();
        }
 
-       imap_append_string(dest, str_c(tmp));
+       imap_append_astring(dest, str_c(tmp));
        str_append_c(dest, ' ');
        imap_acl_write_rights_list(dest, rights);
 }
@@ -288,7 +288,7 @@ static bool cmd_getacl(struct client_command_context *cmd)
 
        str = t_str_new(128);
        str_append(str, "* ACL ");
-       imap_append_string(str, mailbox);
+       imap_append_astring(str, mailbox);
 
        ns = mailbox_get_namespace(box);
        backend = acl_mailbox_list_get_backend(ns->list);
@@ -347,7 +347,7 @@ static bool cmd_myrights(struct client_command_context *cmd)
 
        str = t_str_new(128);
        str_append(str, "* MYRIGHTS ");
-       imap_append_string(str, orig_mailbox);
+       imap_append_astring(str, orig_mailbox);
        str_append_c(str,' ');
        imap_acl_write_rights_list(str, rights);
 
@@ -372,9 +372,9 @@ static bool cmd_listrights(struct client_command_context *cmd)
 
        str = t_str_new(128);
        str_append(str, "* LISTRIGHTS ");
-       imap_append_string(str, mailbox);
+       imap_append_astring(str, mailbox);
        str_append_c(str, ' ');
-       imap_append_string(str, identifier);
+       imap_append_astring(str, identifier);
        str_append_c(str, ' ');
        str_append(str, "\"\" l r w s t p i e k x a c d");
 
index 004691a8b15238488a16be8717c51b66424c8556..039b84f9fa0e71b9fe6668b6a246d9a5d0f4b941 100644 (file)
@@ -43,7 +43,7 @@ quota_reply_write(string_t *str, struct mail_user *user,
 
        str_append(str, "* QUOTA ");
        name = imap_quota_root_get_name(user, owner, root);
-       imap_append_string(str, name);
+       imap_append_astring(str, name);
 
        str_append(str, " (");
        list = quota_root_get_resources(root);
@@ -102,13 +102,13 @@ static bool cmd_getquotaroot(struct client_command_context *cmd)
        quotaroot_reply = t_str_new(128);
        quota_reply = t_str_new(256);
        str_append(quotaroot_reply, "* QUOTAROOT ");
-       imap_append_string(quotaroot_reply, orig_mailbox);
+       imap_append_astring(quotaroot_reply, orig_mailbox);
 
        iter = quota_root_iter_init(box);
        while ((root = quota_root_iter_next(iter)) != NULL) {
                str_append_c(quotaroot_reply, ' ');
                name = imap_quota_root_get_name(client->user, ns->owner, root);
-               imap_append_string(quotaroot_reply, name);
+               imap_append_astring(quotaroot_reply, name);
 
                quota_reply_write(quota_reply, client->user, ns->owner, root);
        }