X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhparse.c;h=3aeb35115563954e5e780959ddba3bb3b52e41b4;hp=6553ac35ff8c6f83055544310bb0b2abfb805062;hb=d39e2c447b0d163a5a63f480b23d06edb7a73aa0;hpb=6e8aba3714fe8ffc21dbb75ea9efdc41ab87b07f diff --git a/uip/mhparse.c b/uip/mhparse.c index 6553ac3..3aeb351 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -205,7 +205,7 @@ parse_mime(char *file) 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)) @@ -281,7 +281,7 @@ get_content(FILE *in, char *file, int toplevel) 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; /* @@ -296,8 +296,8 @@ get_content(FILE *in, char *file, int toplevel) 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) { @@ -357,7 +357,7 @@ get_content(FILE *in, char *file, int toplevel) 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; @@ -429,7 +429,7 @@ get_content(FILE *in, char *file, int toplevel) } /* get copy of this field */ - ct->c_celine = cp = add(hp->value, NULL); + ct->c_celine = cp = getcpy(hp->value); while (isspace(*cp)) cp++; @@ -467,7 +467,7 @@ get_content(FILE *in, char *file, int toplevel) goto next_header; } - ep = cp = add(hp->value, NULL); /* get a copy */ + ep = cp = getcpy(hp->value); while (isspace(*cp)) cp++; @@ -615,7 +615,7 @@ incl_name_value(unsigned char *buf, char *name, char *value) { ** 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'; @@ -688,7 +688,7 @@ get_ctinfo(unsigned char *cp, CT ct, int magic) 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++; @@ -712,7 +712,7 @@ get_ctinfo(unsigned char *cp, CT ct, int magic) 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) { @@ -734,7 +734,7 @@ get_ctinfo(unsigned char *cp, CT ct, int magic) if (*cp != '/') { if (!magic) - ci->ci_subtype = add("", NULL); + ci->ci_subtype = getcpy(""); goto magic_skip; } @@ -748,7 +748,7 @@ get_ctinfo(unsigned char *cp, CT ct, int magic) 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) { @@ -805,7 +805,7 @@ magic_skip: return NOTOK; } - vp = (*ap = add(cp, NULL)) + (up - cp); + vp = (*ap = getcpy(cp)) + (up - cp); *vp = '\0'; for (dp++; isspace(*dp);) dp++; @@ -941,7 +941,7 @@ bad_quote: */ if (*cp) { if (magic) { - ci->ci_magic = add(cp, NULL); + ci->ci_magic = getcpy(cp); /* ** If there is a Content-Disposition header and @@ -1010,7 +1010,7 @@ invalid: ci->ci_comment = concat(dp, " ", buffer, NULL); free(dp); } else { - ci->ci_comment = add(buffer, NULL); + ci->ci_comment = getcpy(buffer); } } @@ -1276,7 +1276,7 @@ last_part: 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) { @@ -1384,7 +1384,7 @@ InitMessage(CT ct) */ 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")) { @@ -1740,10 +1740,10 @@ openBase64(CT ct, char **file) } 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; } @@ -1960,10 +1960,10 @@ openQuoted(CT ct, char **file) } 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; } @@ -2195,10 +2195,10 @@ open7Bit(CT ct, char **file) } 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; } @@ -2583,11 +2583,11 @@ openFTP(CT ct, char **file) } 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, @@ -2786,10 +2786,10 @@ openMail(CT ct, char **file) } 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; } @@ -2805,7 +2805,7 @@ openMail(CT ct, char **file) */ 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;