#include <h/mime.h>
#include <h/mhparse.h>
#include <h/utils.h>
+#include <h/mhcachesbr.h>
+#include "../sbr/m_mktemp.h"
+#include "mhfree.h"
#ifdef HAVE_ICONV
# include <iconv.h>
#endif /* HAVE_ICONV */
extern int debugsw;
-/* cache policies */
-extern int rcachesw; /* mhcachesbr.c */
-extern int wcachesw; /* mhcachesbr.c */
-
int checksw = 0; /* check Content-MD5 field */
/*
};
-/* mhcachesbr.c */
-int find_cache (CT, int, int *, char *, char *, int);
-
/* mhmisc.c */
int part_ok (CT);
int type_ok (CT, int);
void content_error (char *, CT, char *, ...);
-/* mhfree.c */
-void free_encoding (CT, int);
-
/*
* static prototypes
*/
get_content (FILE *in, char *file, int toplevel)
{
int compnum, state;
- char buf[BUFSIZ], name[NAMESZ];
+ char buf[NMH_BUFSIZ], name[NAMESZ];
char *np, *vp;
CT ct;
HF hp;
for (dp = cp; istoken (*dp); dp++)
continue;
- c = *dp, *dp = '\0';
+ c = *dp;
+ *dp = '\0';
ci->ci_type = mh_xstrdup(cp); /* store content type */
- *dp = c, cp = dp;
+ *dp = c;
+ cp = dp;
if (!*ci->ci_type) {
inform("invalid %s: field in message %s (empty type)",
for (dp = cp; istoken (*dp); dp++)
continue;
- c = *dp, *dp = '\0';
+ c = *dp;
+ *dp = '\0';
ci->ci_subtype = mh_xstrdup(cp); /* store the content subtype */
- *dp = c, cp = dp;
+ *dp = c;
+ cp = dp;
if (!*ci->ci_subtype) {
inform("invalid %s: field in message %s (empty subtype for \"%s\")",
for (dp = cp; istoken (*dp); dp++)
continue;
- c = *dp, *dp = '\0';
+ c = *dp;
+ *dp = '\0';
ct->c_dispo_type = mh_xstrdup(cp); /* store disposition type */
- *dp = c, cp = dp;
+ *dp = c;
+ cp = dp;
if (*cp == '(' && get_comment (ct->c_file, DISPO_FIELD, &cp, NULL) == NOTOK)
return NOTOK;
for (ep = (cp = bufp) + cc - 1; cp <= ep; ep--)
if (!isspace ((unsigned char) *ep))
break;
- *++ep = '\n', ep++;
+ *++ep = '\n';
+ ep++;
for (; cp < ep; cp++) {
if (quoted > 0) {
* sequence; let's decode it (above). */
quoted = 1;
continue;
- } else {
- /* One or both of the next 2 is out of range, making this
- * an invalid escape sequence; just show the raw bytes
- * (below). */
}
+ /* One or both of the next 2 is out of range, making this
+ * an invalid escape sequence; just show the raw bytes
+ * (below). */
}
/* Just show the raw byte. */
if (*vp == '*' && vp < up - 1) {
partial = 1;
continue;
- } else if (*vp == '*' && vp == up - 1) {
+ }
+ if (*vp == '*' && vp == up - 1) {
encoded = 1;
} else if (partial) {
if (isdigit((unsigned char) *vp))