dovecot: If IMAP_PARSE_FLAG_ATOM_ALLCHARS is enabled, allow also...

dovecot at dovecot.org dovecot at dovecot.org
Sun Jan 6 16:29:23 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/0355a4603e80
changeset: 7131:0355a4603e80
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jan 06 16:29:19 2008 +0200
description:
If IMAP_PARSE_FLAG_ATOM_ALLCHARS is enabled, allow also ')' characters in
atoms if no lists are open.

diffstat:

1 file changed, 9 insertions(+), 2 deletions(-)
src/lib-imap/imap-parser.c |   11 +++++++++--

diffs (23 lines):

diff -r 26dbad6c08f3 -r 0355a4603e80 src/lib-imap/imap-parser.c
--- a/src/lib-imap/imap-parser.c	Sun Jan 06 11:59:21 2008 +0200
+++ b/src/lib-imap/imap-parser.c	Sun Jan 06 16:29:19 2008 +0200
@@ -253,10 +253,17 @@ static int imap_parser_read_atom(struct 
 
 	/* read until we've found space, CR or LF. */
 	for (i = parser->cur_pos; i < data_size; i++) {
-		if (data[i] == ' ' || data[i] == ')' ||
-			 is_linebreak(data[i])) {
+		if (data[i] == ' ' || is_linebreak(data[i])) {
 			imap_parser_save_arg(parser, data, i);
 			break;
+		} else if (data[i] == ')') {
+			if (parser->list_arg != NULL ||
+			    (parser->flags &
+			     IMAP_PARSE_FLAG_ATOM_ALLCHARS) == 0) {
+				imap_parser_save_arg(parser, data, i);
+				break;
+			}
+			/* assume it's part of the atom */
 		} else if (!is_valid_atom_char(parser, data[i]))
 			return FALSE;
 	}


More information about the dovecot-cvs mailing list