#include <h/mime.h>
#include <h/mhparse.h>
#include <h/utils.h>
+#include "h/mhcachesbr.h"
+#include "mhmisc.h"
#include "../sbr/m_mktemp.h"
#include "../sbr/message_id.h"
#include "../sbr/mime_type.h"
} convert_list;
-/* mhmisc.c */
-void content_error (char *, CT, char *, ...);
-
-/* mhcachesbr.c */
-int find_cache (CT, int, int *, char *, char *, int);
-
/*
* static prototypes
*/
attach_head = attach_tail = entry;
}
} else if (strncasecmp(MHBUILD_FILE_PSEUDOHEADER, np,
- strlen (MHBUILD_FILE_PSEUDOHEADER)) == 0) {
+ LEN(MHBUILD_FILE_PSEUDOHEADER)) == 0) {
/* E.g.,
* Nmh-mhbuild-file-text/calendar: /home/user/Mail/inbox/9
*/
- char *type = np + strlen (MHBUILD_FILE_PSEUDOHEADER);
+ char *type = np + LEN(MHBUILD_FILE_PSEUDOHEADER);
char *filename = vp;
/* vp should begin with a space because m_getfld2()
free (vp);
free (np);
} else if (strncasecmp(MHBUILD_ARGS_PSEUDOHEADER, np,
- strlen (MHBUILD_ARGS_PSEUDOHEADER)) == 0) {
+ LEN(MHBUILD_ARGS_PSEUDOHEADER)) == 0) {
/* E.g.,
* Nmh-mhbuild-args-text/calendar: -reply accept
*/
- char *type = np + strlen (MHBUILD_ARGS_PSEUDOHEADER);
+ char *type = np + LEN(MHBUILD_ARGS_PSEUDOHEADER);
char *argstring = vp;
/* vp should begin with a space because m_getfld2()
ct->c_ceclosefnx = close_encoding;
ct->c_cesizefnx = NULL; /* since unencoded */
ct->c_encoding = CE_7BIT; /* Seems like a reasonable default */
- ct->c_file = add(filename, NULL);
+ ct->c_file = mh_xstrdup(FENDNULL(filename));
return OK;
}
int i;
if (headers >= 0 && do_direct() && uprf (buffer, DESCR_FIELD)
- && buffer[i = strlen (DESCR_FIELD)] == ':') {
+ && buffer[i = LEN(DESCR_FIELD)] == ':') {
headers = 1;
again_descr:
}
if (headers >= 0 && do_direct() && uprf (buffer, DISPO_FIELD)
- && buffer[i = strlen (DISPO_FIELD)] == ':') {
+ && buffer[i = LEN(DISPO_FIELD)] == ':') {
headers = 1;
again_dispo:
vp = concat (" ", ci->ci_type, "/", ci->ci_subtype, NULL);
/* keep track of length of line */
- len = strlen (TYPE_FIELD) + strlen (ci->ci_type)
+ len = LEN(TYPE_FIELD) + strlen (ci->ci_type)
+ strlen (ci->ci_subtype) + 3;
extbody = ct->c_type == CT_MESSAGE && ct->c_subtype == MESSAGE_EXTERNAL;
add_header (ct, np, vp);
} else if (ct->c_dispo_type) {
vp = concat (" ", ct->c_dispo_type, NULL);
- len = strlen(DISPO_FIELD) + strlen(vp) + 1;
+ len = LEN(DISPO_FIELD) + strlen(vp) + 1;
np = output_params(len, ct->c_dispo_first, NULL, 0);
vp = add(np, vp);
vp = add("\n", vp);
buffer[statbuf.st_size] = '\0';
/* Look for a header in the convert reply. */
- if (strncasecmp (buffer, TYPE_FIELD, strlen (TYPE_FIELD)) == 0 &&
- buffer[strlen (TYPE_FIELD)] == ':') {
+ if (strncasecmp (buffer, TYPE_FIELD, LEN(TYPE_FIELD)) == 0 &&
+ buffer[LEN(TYPE_FIELD)] == ':') {
if ((end_of_header = strstr (buffer, "\r\n\r\n"))) {
end_of_header += 2;
found_header = 1;