linelen++; if (ch == '\n') { info->crlf++; if (whitespace) info->space = 1; if (dot) info->dot = 1; if (linelen > info->linemax) info->linemax = linelen; whitespace = 0; linelen = 0; dot = 0; } else if (ch == '\r') { info->crlf++; info->cr = 1; if ((ch = fgetc (fp)) == EOF) { info->binary = 1; break; } else if (ch != '\n') { info->binary = 1; ungetc (ch, fp); continue; } else { if (whitespace) info->space = 1; if (dot) info->dot = 1; if (linelen > info->linemax) info->linemax = linelen; whitespace = 0; dot = 0; linelen = 0; } } else if (ch & 0x80) info->hibin++; else if (ch == '\t' || ch == '\f') { info->ascii++; whitespace++; } else if (ch < 32 || ch == 127) info->lobin++; else { if (linelen == 1) { if (ch == 'F') from = 1; else from = 0; if (ch == '.') dot = 1; else dot = 0; } else if (from) { if (linelen == 2 && ch != 'r') from = 0; else if (linelen == 3 && ch != 'o') from = 0; else if (linelen == 4) { if (ch == 'm') info->from = 1; from = 0; } } if (ch == ' ') whitespace++; info->ascii++; }
char buffer[100]; size_t r;
CONTENT *mutt_get_content_info (const char *fname, BODY *b){  char send_charset[SHORT_STRING];  CONTENT *info;  FILE *fp;  FGETCONV *fc;  int ch, from=0, whitespace=0, dot=0, linelen=0;  if(b && !fname) fname = b->filename;    if ((fp = fopen (fname, "r")) == NULL)  {    dprint (1, (debugfile, "mutt_get_content_info: %s: %s (errno %d).\n",		fname, strerror (errno), errno));    return (NULL);  }  if (b != NULL && b->type == TYPETEXT && (!b->noconv))    fc = fgetconv_open (fp, Charset, mutt_get_send_charset (send_charset, sizeof (send_charset), b, 1));  else    fc = fgetconv_open (fp, 0, 0);  info = safe_calloc (1, sizeof (CONTENT));  while ((ch = fgetconv (fc)) != EOF)  {    linelen++;    if (ch == '\n')    {      info->crlf++;      if (whitespace) info->space = 1;      if (dot) info->dot = 1;      if (linelen > info->linemax) info->linemax = linelen;      whitespace = 0;      linelen = 0;      dot = 0;    }    else if (ch == '\r')    {      info->crlf++;      info->cr = 1;      if ((ch = fgetc (fp)) == EOF)      {        info->binary = 1;        break;      }      else if (ch != '\n')      {        info->binary = 1;	ungetc (ch, fp);	continue;      }      else      {        if (whitespace) info->space = 1;	if (dot) info->dot = 1;        if (linelen > info->linemax) info->linemax = linelen;        whitespace = 0;	dot = 0;        linelen = 0;      }    }    else if (ch & 0x80)      info->hibin++;    else if (ch == '\t' || ch == '\f')    {      info->ascii++;      whitespace++;    }    else if (ch < 32 || ch == 127)      info->lobin++;    else    {      if (linelen == 1)      {        if (ch == 'F')          from = 1;        else          from = 0;        if (ch == '.')          dot = 1;        else          dot = 0;      }      else if (from)      {        if (linelen == 2 && ch != 'r') from = 0;        else if (linelen == 3 && ch != 'o') from = 0;        else if (linelen == 4)	{          if (ch == 'm') info->from = 1;          from = 0;        }      }      if (ch == ' ') whitespace++;      info->ascii++;    }    if (linelen > 1) dot = 0;    if (ch != ' ' && ch != '\t') whitespace = 0;  }  fgetconv_close (fc);  fclose (fp);  return (info);}