Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7131:0355a4603e80 HEAD
If IMAP_PARSE_FLAG_ATOM_ALLCHARS is enabled, allow also ')' characters in
atoms if no lists are open.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 06 Jan 2008 16:29:19 +0200 |
parents | 26dbad6c08f3 |
children | a1d1f7c9671e |
files | src/lib-imap/imap-parser.c |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ /* 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; }