Fix imap4d input tokenizer.
The proper delimiters are ( and ), listed in RFC as atom_specials. The characters "[]<>." are delimiters for FETCH, and "." is a delimiter for STORE. Fix tokenizer to recognize these only in the corresponding contexts. In particular, it fixes parsing of input atoms containing dots, as foo@bar.baz, which previous versions incorrectly splitted in three. * imap4d/util.c (ISDELIM): Delimiters are only ( and ) * imap4d/imap4d.h (struct imap4d_parsebuf): new data type. (imap4d_parsebuf_t): New data type. (imap4d_parsebuf_exit, imap4d_parsebuf_peek) (imap4d_parsebuf_next, imap4d_parsebuf_token) (imap4d_parsebuf_data, imap4d_with_parsebuf): New prototypes. * imap4d/parsebuf.c: New file. * imap4d/Makefile.am: Add parsebuf.c * imap4d/fetch.c, imap4d/store.c: Rewrite using parsebuf functions.
Showing
6 changed files
with
327 additions
and
117 deletions
This diff is collapsed.
Click to expand it.
imap4d/parsebuf.c
0 → 100644
-
Please register or sign in to post a comment