{
long hibin; /* 8-bit characters */
long lobin; /* unprintable 7-bit chars (eg., control chars) */
+ long nulbin; /* null characters (0x0) */
long crlf; /* '\r' and '\n' characters */
long ascii; /* number of ascii chars */
long linemax; /* length of the longest line in the file */
info->ascii++;
whitespace++;
}
+ else if (ch == 0)
+ {
+ info->nulbin++;
+ info->lobin++;
+ }
else if (ch < 32 || ch == 127)
info->lobin++;
else
/* Attempt to determine the appropriate content-type based on the filename
* suffix.
*/
-
-#if 0
-
- if ((n = mutt_lookup_mime_type (buf, sizeof (buf), xbuf, sizeof (xbuf), path)) != TYPEOTHER
- || *xbuf != '\0')
- {
- att->type = n;
- att->subtype = safe_strdup (buf);
- att->xtype = safe_strdup (xbuf);
- }
-
-#else
-
mutt_lookup_mime_type (att, path);
-#endif
-
if ((info = mutt_get_content_info (path, att)) == NULL)
{
mutt_free_body (&att);
if (!att->subtype)
{
- if (info->lobin == 0 || (info->lobin + info->hibin + info->ascii)/ info->lobin >= 10)
+ if ((info->nulbin == 0) &&
+ (info->lobin == 0 || (info->lobin + info->hibin + info->ascii)/ info->lobin >= 10))
{
/*
* Statistically speaking, there should be more than 10% "lobin"