IMAP_LIST* list;
IMAP_LIST lb;
char delimbuf[5]; /* worst case: "\\"\0 */
+ long litlen;
if (idata->cmddata)
list = (IMAP_LIST*)idata->cmddata;
/* Name */
s = imap_next_word (s);
- imap_unmunge_mbox_name (s);
- list->name = s;
-
+ /* Notes often responds with literals here. We need a real tokenizer. */
+ if (!imap_get_literal_count (s, &litlen))
+ {
+ if (imap_cmd_step (idata) != IMAP_CMD_CONTINUE)
+ {
+ idata->status = IMAP_FATAL;
+ return;
+ }
+ list->name = idata->buf;
+ }
+ else
+ {
+ imap_unmunge_mbox_name (s);
+ list->name = s;
+ }
+
if (list->name[0] == '\0')
{
idata->delim = list->delim;
char *pc;
char *pn;
- if (!(pc = strchr (buf, '{')))
- return (-1);
+ if (!buf || !(pc = strchr (buf, '{')))
+ return -1;
+
pc++;
pn = pc;
while (isdigit ((unsigned char) *pc))
pc++;
*pc = 0;
*bytes = atoi(pn);
- return (0);
+
+ return 0;
}
/* imap_get_qualifier: in a tagged response, skip tag and status for