[evolution-data-server/gnome-2-30] Bug 610919 - Remove superfluous space in flags in APPEND command
- From: David Woodhouse <dwmw2 src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-2-30] Bug 610919 - Remove superfluous space in flags in APPEND command
- Date: Tue, 15 Jun 2010 11:27:54 +0000 (UTC)
commit a447772498922ecea6cb1d58a4e22ed274076301
Author: David Woodhouse <David Woodhouse intel com>
Date: Tue Jun 15 12:24:51 2010 +0100
Bug 610919 - Remove superfluous space in flags in APPEND command
RFC3501 doesn't permit a space between the final flag and the closing
parenthesis, and Exchange will reject the command if it's there.
(cherry picked from commit fab0477c103b348c9b567976b13b877b52534f7a)
camel/providers/imapx/camel-imapx-utils.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-utils.c b/camel/providers/imapx/camel-imapx-utils.c
index 59d4d37..ce0e2a6 100644
--- a/camel/providers/imapx/camel-imapx-utils.c
+++ b/camel/providers/imapx/camel-imapx-utils.c
@@ -144,6 +144,7 @@ imapx_write_flags(CamelStream *stream, guint32 flags, CamelFlag *user_flags, Cam
/* throws IO exception */
{
gint i;
+ gboolean first = TRUE;
if (camel_stream_write(stream, "(", 1) == -1) {
camel_exception_setv (ex, 1, "io error: %s", strerror(errno));
@@ -154,30 +155,29 @@ imapx_write_flags(CamelStream *stream, guint32 flags, CamelFlag *user_flags, Cam
if (flag_table[i].flag & flags) {
if (flags & CAMEL_IMAPX_MESSAGE_RECENT)
continue;
-
+ if (!first && camel_stream_write(stream, " ", 1) == -1) {
+ camel_exception_setv (ex, 1, "io error: %s", strerror(errno));
+ return;
+ }
+ first = FALSE;
if (camel_stream_write (stream, flag_table[i].name, strlen(flag_table[i].name)) == -1) {
camel_exception_setv (ex,1, "io error: %s", strerror(errno));
return;
}
flags &= ~flag_table[i].flag;
- if (flags != 0 && user_flags == NULL)
- if (camel_stream_write(stream, " ", 1) == -1) {
- camel_exception_setv (ex, 1, "io error: %s", strerror(errno));
- return;
- }
}
}
while (user_flags) {
const gchar *flag_name = rename_label_flag (user_flags->name, strlen (user_flags->name), FALSE);
- if (camel_stream_write(stream, flag_name, strlen (flag_name)) == -1) {
+ if (!first && camel_stream_write(stream, " ", 1) == -1) {
camel_exception_setv (ex, 1, "io error: %s", strerror(errno));
return;
}
-
- if (user_flags->next && camel_stream_write(stream, " ", 1) == -1) {
+ first = FALSE;
+ if (camel_stream_write(stream, flag_name, strlen (flag_name)) == -1) {
camel_exception_setv (ex, 1, "io error: %s", strerror(errno));
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]