h->read = 0;
static int imap_parse_fetch (IMAP_HEADER_INFO *h, char *s){  char tmp[SHORT_STRING];  char *ptmp;  int state = 0;  if (!s)    return (-1);  h->read = 0;  h->old = 0;  while (*s)  {    SKIPWS (s);    switch (state)    {      case 0:	if (mutt_strncasecmp ("FLAGS", s, 5) == 0)	{	  s += 5;	  SKIPWS (s);	  if (*s != '(')	  {	    dprint (1, (debugfile, "imap_parse_fetch(): bogus FLAGS entry: %s\n", s));	    return (-1); /* parse error */	  }	  /* we're about to get a new set of headers, so clear the old ones. */	  h->deleted=0; h->flagged=0;	  h->replied=0; h->read=0;	  h->changed=0;	  s++;	  state = 1;	}	else if (mutt_strncasecmp ("INTERNALDATE", s, 12) == 0)	{	  s += 12;	  SKIPWS (s);	  if (*s != '\"')	  {	    dprint (1, (debugfile, "imap_parse_fetch(): bogus INTERNALDATE entry: %s\n", s));	    return (-1);	  }	  s++;	  ptmp = tmp;	  while (*s && *s != '\"')	    *ptmp++ = *s++;	  if (*s != '\"')	    return (-1);	  s++; /* skip past the trailing " */	  *ptmp = 0;	  h->received = imap_parse_date (tmp);	}	else if (mutt_strncasecmp ("RFC822.SIZE", s, 11) == 0)	{	  s += 11;	  SKIPWS (s);	  ptmp = tmp;	  while (isdigit (*s))	    *ptmp++ = *s++;	  *ptmp = 0;	  h->content_length += atoi (tmp);	}	else if (*s == ')')	  s++; /* end of request */	else if (*s)	{	  /* got something i don't understand */	  imap_error ("imap_parse_fetch()", s);	  return (-1);	}	break;      case 1: /* flags */	if (*s == ')')	{	  s++;	  state = 0;	}	else if (mutt_strncasecmp ("\\deleted", s, 8) == 0)	{	  s += 8;	  h->deleted = 1;	}	else if (mutt_strncasecmp ("\\flagged", s, 8) == 0)	{	  s += 8;	  h->flagged = 1;	}	else if (mutt_strncasecmp ("\\answered", s, 9) == 0)	{	  s += 9;	  h->replied = 1;	}	else if (mutt_strncasecmp ("\\seen", s, 5) == 0)	{	  s += 5;	  h->read = 1;	}	else	{	  while (*s && !ISSPACE (*s) && *s != ')')	    s++;	}	break;    }  }  return 0;}