From: Timo Sirainen Date: Fri, 20 Mar 2009 16:28:37 +0000 (-0400) Subject: IMAP: ESORT extension was implemented wrong. X-Git-Tag: 1.2.beta4~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9995d93294b03312d3fcd99cad602f97af9bff40;p=thirdparty%2Fdovecot%2Fcore.git IMAP: ESORT extension was implemented wrong. --HG-- branch : HEAD --- diff --git a/src/imap/cmd-sort.c b/src/imap/cmd-sort.c index bf14064c5e..43e23a804e 100644 --- a/src/imap/cmd-sort.c +++ b/src/imap/cmd-sort.c @@ -102,6 +102,14 @@ bool cmd_sort(struct client_command_context *cmd) if (!client_verify_open_mailbox(cmd)) return TRUE; + ctx = p_new(cmd->pool, struct imap_search_context, 1); + ctx->cmd = cmd; + + if ((ret = cmd_search_parse_return_if_found(ctx, &args)) <= 0) { + /* error / waiting for unambiguity */ + return ret < 0; + } + /* sort program */ if (args->type != IMAP_ARG_LIST) { client_send_command_error(cmd, "Invalid sort argument."); @@ -121,14 +129,6 @@ bool cmd_sort(struct client_command_context *cmd) charset = IMAP_ARG_STR(args); args++; - ctx = p_new(cmd->pool, struct imap_search_context, 1); - ctx->cmd = cmd; - - if ((ret = cmd_search_parse_return_if_found(ctx, &args)) <= 0) { - /* error / waiting for unambiguity */ - return ret < 0; - } - ret = imap_search_args_build(cmd, args, charset, &sargs); if (ret <= 0) return ret < 0;