X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhparse.c;h=fc5d570790771439cb7e510466ee292ecceb25f0;hp=cf264c6f2f433a5b3b934db6062364899cab473b;hb=55eda7c77fdf33b0a7175968471df55e2600379c;hpb=55e1d8c654ee0f7c45b9361ce34617983b454c32 diff --git a/uip/mhparse.c b/uip/mhparse.c index cf264c6..fc5d570 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -8,10 +8,7 @@ #include #include -#include #include -#include -#include #include #include #include @@ -137,7 +134,7 @@ pidcheck(int status) fflush(stdout); fflush(stderr); - done(1); + exit(1); return 1; } @@ -963,9 +960,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 +987,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 +1000,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 +1533,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 +1749,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 +1961,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') {