Changeset 5405:96a01436f88b for imap

Show
Ignore:
Timestamp:
2008-05-22 20:22:46 (6 months ago)
Author:
Brendan Cully <brendan@…>
Branch:
HEAD
Message:

Escape LSUB mailbox names given to mutt_parse_rc_line.
Handle literals in STATUS responses for Notes compatibility.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • imap/command.c

    r5291 r5405  
    697697  strfcpy (buf, "mailboxes \"", sizeof (buf)); 
    698698  mutt_account_tourl (&idata->conn->account, &url); 
    699   url.path = list.name; 
     699  /* escape \ and " */ 
     700  imap_quote_string(errstr, sizeof (errstr), list.name); 
     701  url.path = errstr + 1; 
     702  url.path[strlen(url.path) - 1] = '\0'; 
    700703  if (!mutt_strcmp (url.user, ImapUser)) 
    701704    url.user = NULL; 
     
    819822  IMAP_STATUS *status; 
    820823  unsigned int olduv, oldun; 
     824  long litlen; 
    821825 
    822826  mailbox = imap_next_word (s); 
    823   s = imap_next_word (mailbox); 
    824   *(s - 1) = '\0'; 
    825   imap_unmunge_mbox_name (mailbox); 
     827 
     828  /* We need a real tokenizer. */ 
     829  if (!imap_get_literal_count (mailbox, &litlen)) 
     830  { 
     831    if (imap_cmd_step (idata) != IMAP_CMD_CONTINUE) 
     832    { 
     833      idata->status = IMAP_FATAL; 
     834      return; 
     835    } 
     836    mailbox = idata->buf; 
     837    s = mailbox + litlen; 
     838    *s = '\0'; 
     839    s++; 
     840    SKIPWS(s); 
     841  } 
     842  else 
     843  { 
     844    s = imap_next_word (mailbox); 
     845    *(s - 1) = '\0'; 
     846    imap_unmunge_mbox_name (mailbox); 
     847  } 
    826848 
    827849  status = imap_mboxcache_get (idata, mailbox, 1);