advise("mhparse", "unable to create temporary file");
return NULL;
}
- file = add(tfile, NULL);
+ file = getcpy(tfile);
chmod(file, 0600);
while (fgets(buffer, sizeof(buffer), stdin))
adios(NULL, "out of memory");
ct->c_fp = in;
- ct->c_file = add(file, NULL);
+ ct->c_file = getcpy(file);
ct->c_begin = ftell(ct->c_fp) + 1;
/*
compnum++;
/* get copies of the buffers */
- np = add(name, NULL);
- vp = add(buf, NULL);
+ np = getcpy(name);
+ vp = getcpy(buf);
/* if necessary, get rest of field */
while (state == FLDPLUS) {
advise(NULL, "message %s has multiple %s: fields", ct->c_file, VRSN_FIELD);
goto next_header;
}
- ct->c_vrsn = add(hp->value, NULL);
+ ct->c_vrsn = getcpy(hp->value);
/* Now, cleanup this field */
cp = ct->c_vrsn;
}
/* get copy of this field */
- ct->c_celine = cp = add(hp->value, NULL);
+ ct->c_celine = cp = getcpy(hp->value);
while (isspace(*cp))
cp++;
goto next_header;
}
- ep = cp = add(hp->value, NULL); /* get a copy */
+ ep = cp = getcpy(hp->value);
while (isspace(*cp))
cp++;
** Insert at first semicolon, if any.
** If none, append to end.
*/
- prefix = add(buf, NULL);
+ prefix = getcpy(buf);
if ((cp = strchr(prefix, ';'))) {
suffix = concat(cp, NULL);
*cp = '\0';
i = strlen(invo_name) + 2;
/* store copy of Content-Type line */
- cp = ct->c_ctline = add(cp, NULL);
+ cp = ct->c_ctline = getcpy(cp);
while (isspace(*cp)) /* trim leading spaces */
cp++;
for (dp = cp; istoken(*dp); dp++)
continue;
c = *dp, *dp = '\0';
- ci->ci_type = add(cp, NULL); /* store content type */
+ ci->ci_type = getcpy(cp); /* store content type */
*dp = c, cp = dp;
if (!*ci->ci_type) {
if (*cp != '/') {
if (!magic)
- ci->ci_subtype = add("", NULL);
+ ci->ci_subtype = getcpy("");
goto magic_skip;
}
for (dp = cp; istoken(*dp); dp++)
continue;
c = *dp, *dp = '\0';
- ci->ci_subtype = add(cp, NULL); /* store the content subtype */
+ ci->ci_subtype = getcpy(cp); /* store the content subtype */
*dp = c, cp = dp;
if (!*ci->ci_subtype) {
return NOTOK;
}
- vp = (*ap = add(cp, NULL)) + (up - cp);
+ vp = (*ap = getcpy(cp)) + (up - cp);
*vp = '\0';
for (dp++; isspace(*dp);)
dp++;
*/
if (*cp) {
if (magic) {
- ci->ci_magic = add(cp, NULL);
+ ci->ci_magic = getcpy(cp);
/*
** If there is a Content-Disposition header and
ci->ci_comment = concat(dp, " ", buffer, NULL);
free(dp);
} else {
- ci->ci_comment = add(buffer, NULL);
+ ci->ci_comment = getcpy(buffer);
}
}
p = part->mp_part;
sprintf(pp, "%d", partnum);
- p->c_partno = add(partnam, NULL);
+ p->c_partno = getcpy(partnam);
/* initialize the content of the subparts */
if (p->c_ctinitfnx && (*p->c_ctinitfnx) (p) == NOTOK) {
*/
for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) {
if (!mh_strcasecmp(*ap, "id")) {
- p->pm_partid = add(*ep, NULL);
+ p->pm_partid = getcpy(*ep);
continue;
}
if (!mh_strcasecmp(*ap, "number")) {
}
if (*file == NULL) {
- ce->ce_file = add(m_mktemp(tmp, NULL, NULL), NULL);
+ ce->ce_file = getcpy(m_mktemp(tmp, NULL, NULL));
ce->ce_unlink = 1;
} else {
- ce->ce_file = add(*file, NULL);
+ ce->ce_file = getcpy(*file);
ce->ce_unlink = 0;
}
}
if (*file == NULL) {
- ce->ce_file = add(m_mktemp(tmp, NULL, NULL), NULL);
+ ce->ce_file = getcpy(m_mktemp(tmp, NULL, NULL));
ce->ce_unlink = 1;
} else {
- ce->ce_file = add(*file, NULL);
+ ce->ce_file = getcpy(*file);
ce->ce_unlink = 0;
}
}
if (*file == NULL) {
- ce->ce_file = add(m_mktemp(tmp, NULL, NULL), NULL);
+ ce->ce_file = getcpy(m_mktemp(tmp, NULL, NULL));
ce->ce_unlink = 1;
} else {
- ce->ce_file = add(*file, NULL);
+ ce->ce_file = getcpy(*file);
ce->ce_unlink = 0;
}
}
if (*file)
- ce->ce_file = add(*file, NULL);
+ ce->ce_file = getcpy(*file);
else if (caching)
- ce->ce_file = add(cachefile, NULL);
+ ce->ce_file = getcpy(cachefile);
else
- ce->ce_file = add(m_mktemp(tmp, NULL, NULL), NULL);
+ ce->ce_file = getcpy(m_mktemp(tmp, NULL, NULL));
if ((ce->ce_fp = fopen(ce->ce_file, "w+")) == NULL) {
content_error (ce->ce_file, ct,
}
if (*file == NULL) {
- ce->ce_file = add(m_mktemp(tmp, NULL, NULL), NULL);
+ ce->ce_file = getcpy(m_mktemp(tmp, NULL, NULL));
ce->ce_unlink = 1;
} else {
- ce->ce_file = add(*file, NULL);
+ ce->ce_file = getcpy(*file);
ce->ce_unlink = 0;
}
*/
if (ct->c_showproc)
free(ct->c_showproc);
- ct->c_showproc = add("true", NULL);
+ ct->c_showproc = getcpy("true");
fseek(ce->ce_fp, 0L, SEEK_SET);
*file = ce->ce_file;