X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhparse.c;h=af460e6a0df624ea9b5b3a1b6eae9a380834f6e5;hp=cf264c6f2f433a5b3b934db6062364899cab473b;hb=264f6e648f566f8efaa0188fb6a9e4908329d6d6;hpb=55e1d8c654ee0f7c45b9361ce34617983b454c32 diff --git a/uip/mhparse.c b/uip/mhparse.c index cf264c6..af460e6 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -963,9 +963,7 @@ InitGeneric(CT ct) static int InitText(CT ct) { - char buffer[BUFSIZ]; - char *chset = NULL; - char **ap, **ep, *cp; + char **ap, **ep; struct k2v *kv; struct text *t; CI ci = &ct->c_ctinfo; @@ -992,10 +990,11 @@ InitText(CT ct) /* check if content specified a character set */ if (*ap) { + /* store its name */ + ct->c_charset = getcpy(norm_charmap(*ep)); /* match character set or set to CHARSET_UNKNOWN */ for (kv = Charset; kv->kv_key; kv++) { if (!mh_strcasecmp(*ep, kv->kv_key)) { - chset = *ep; break; } } @@ -1004,20 +1003,6 @@ InitText(CT ct) t->tx_charset = CHARSET_UNSPECIFIED; } - /* - ** If we can not handle character set natively, - ** then check profile for string to modify the - ** terminal or display method. - ** - ** termproc is for mhshow, though mhlist -debug prints it, too. - */ - if (chset != NULL && !check_charset(chset, strlen(chset))) { - snprintf(buffer, sizeof(buffer), "%s-charset-%s", - invo_name, chset); - if ((cp = context_find(buffer))) - ct->c_termproc = getcpy(cp); - } - return OK; } @@ -1551,7 +1536,7 @@ openBase64(CT ct, char **file) cp = context_find(buffer); if (cp == NULL || *cp == '\0') { snprintf(buffer, sizeof(buffer), "%s-suffix-%s", invo_name, - ci->ci_type); + ci->ci_type); cp = context_find(buffer); } if (cp != NULL && *cp != '\0') { @@ -1767,8 +1752,10 @@ openQuoted(CT ct, char **file) } if (cp != NULL && *cp != '\0') { if (ce->ce_unlink) { - // Temporary file already exists, so we rename to - // version with extension. + /* + ** Temporary file already exists, so we rename to + ** version with extension. + */ char *file_org = strdup(ce->ce_file); ce->ce_file = add(cp, ce->ce_file); if (rename(file_org, ce->ce_file)) { @@ -1977,7 +1964,7 @@ open7Bit(CT ct, char **file) cp = context_find(buffer); if (cp == NULL || *cp == '\0') { snprintf(buffer, sizeof(buffer), "%s-suffix-%s", invo_name, - ci->ci_type); + ci->ci_type); cp = context_find(buffer); } if (cp != NULL && *cp != '\0') {