FILE *fp;
CT ct;
size_t n;
+ struct stat statbuf;
bogus_mp_content = 0;
return NULL;
}
fseek (fp, 0L, SEEK_SET);
+ } else if (lstat (file, &statbuf) == NOTOK) {
+ advise (file, "unable to lstat");
+ return NULL;
+ } else if (S_ISDIR(statbuf.st_mode)) {
+ /* Don't try to parse a directory. */
+ advise (NULL, "%s is a directory", file);
+ return NULL;
} else if ((fp = fopen (file, "r")) == NULL) {
advise (file, "unable to read");
return NULL;
TYPE_FIELD, ct->c_file);
return NOTOK;
}
- ToLower(ci->ci_type);
+ to_lower(ci->ci_type);
while (isspace ((unsigned char) *cp))
cp++;
TYPE_FIELD, ct->c_file, ci->ci_type);
return NOTOK;
}
- ToLower(ci->ci_subtype);
+ to_lower(ci->ci_subtype);
magic_skip:
while (isspace ((unsigned char) *cp))
case '(':
i++;
- /* and fall... */
+ /* FALLTHRU */
default:
*bp++ = c;
continue;
case CT_MESSAGE:
if (p->c_subtype != MESSAGE_RFC822)
break;
- /* else fall... */
+ /* FALLTHRU */
default:
e->eb_partno = ct->c_partno;
if (p->c_ctinitfnx)
case '\\':
if (*++cp == '\0')
goto bad_quote;
- /* FALL THROUGH */
+ /* FALLTHRU */
default:
len++;
continue;
case '\\':
len++;
maxfit--;
- /* FALL THROUGH */
+ /* FALLTHRU */
default:
len++;
maxfit--;
case '"':
*output++ = '\\';
outlen++;
+ /* FALLTHRU */
default:
*output++ = *p++;
outlen++;
#endif /* HAVE_ICONV */
/*
- * Take everything non-ASCII and substituite the replacement character
+ * Take everything non-ASCII and substitute the replacement character
*/
q = buffer;
bufsize = sizeof(buffer);
for (p = pm->pm_value; *p != '\0' && bufsize > 1; p++, q++, bufsize--) {
- /* FIXME: !iscntrl should perhaps be isprint as that allows all
- * classes bar cntrl, whereas the cntrl class can include those
- * in space and blank.
- * http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html */
- if (isascii((unsigned char) *p) && !iscntrl((unsigned char) *p))
+ if (isascii((unsigned char) *p) && isprint((unsigned char) *p))
*q = *p;
else
*q = replace;