From ae7b8c3242c45fe5ab51bbd1e948a4161b5092c0 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 12 Nov 2004 18:28:40 +0000 Subject: Properly handle NILs for the namespace separator (somehow I missed this, 2004-11-12 Jeffrey Stedfast * providers/imap4/camel-imap4-engine.c (engine_parse_namespace): Properly handle NILs for the namespace separator (somehow I missed this, silly me). svn path=/trunk/; revision=27906 --- camel/ChangeLog | 6 ++++++ camel/providers/imap4/camel-imap4-engine.c | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index 6fe3ebbbb9..3343c96247 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2004-11-12 Jeffrey Stedfast + + * providers/imap4/camel-imap4-engine.c (engine_parse_namespace): + Properly handle NILs for the namespace separator (somehow I missed + this, silly me). + 2004-11-12 Not Zed ** Merge in notzed-messageinfo-branch, fix some minor conflicts. diff --git a/camel/providers/imap4/camel-imap4-engine.c b/camel/providers/imap4/camel-imap4-engine.c index 87cf54b35d..d392f054ea 100644 --- a/camel/providers/imap4/camel-imap4-engine.c +++ b/camel/providers/imap4/camel-imap4-engine.c @@ -604,8 +604,19 @@ engine_parse_namespace (CamelIMAP4Engine *engine, CamelException *ex) goto exception; } - if (token.token != CAMEL_IMAP4_TOKEN_QSTRING || strlen (token.v.qstring) > 1) { - d(fprintf (stderr, "Expected to find a qstring token as second element in NAMESPACE pair\n")); + switch (token.token) { + case CAMEL_IMAP4_TOKEN_NIL: + node->sep = '\0'; + break; + case CAMEL_IMAP4_TOKEN_QSTRING: + if (strlen (token.v.qstring) == 1) { + node->sep = *token.v.qstring; + break; + } else { + /* invalid, fall thru */ + } + default: + d(fprintf (stderr, "Expected to find a nil or a valid qstring token as second element in NAMESPACE pair\n")); camel_imap4_utils_set_unexpected_token_error (ex, engine, &token); g_free (node->path); g_free (node); @@ -613,7 +624,6 @@ engine_parse_namespace (CamelIMAP4Engine *engine, CamelException *ex) goto exception; } - node->sep = *token.v.qstring; tail->next = node; tail = node; -- cgit v1.2.3