projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
generalize the idea of tokens a bit more, don't restrict it to the rfc822
[apps/madmutt.git]
/
lib-mime
/
rfc2047.c
diff --git
a/lib-mime/rfc2047.c
b/lib-mime/rfc2047.c
index
3bd353c
..
264caff
100644
(file)
--- a/
lib-mime/rfc2047.c
+++ b/
lib-mime/rfc2047.c
@@
-304,7
+304,7
@@
static size_t try_block(const char *d, ssize_t dlen,
len_q = len + (ob - buf1) + 2 * count;
/* Apparently RFC 1468 says to use B encoding for iso-2022-jp. */
len_q = len + (ob - buf1) + 2 * count;
/* Apparently RFC 1468 says to use B encoding for iso-2022-jp. */
- if (
!ascii_strcasecmp(tocode, "ISO-2022-JP")
)
+ if (
mime_which_token(tocode, -1) == MIME_ISO_2022_JP
)
len_q = ENCWORD_LEN_MAX + 1;
if (len_b < len_q && len_b <= ENCWORD_LEN_MAX) {
len_q = ENCWORD_LEN_MAX + 1;
if (len_b < len_q && len_b <= ENCWORD_LEN_MAX) {
@@
-361,7
+361,7
@@
static size_t choose_block(char *d, size_t dlen, int col,
encoder_t **encoder, ssize_t *wlen)
{
size_t n, nn;
encoder_t **encoder, ssize_t *wlen)
{
size_t n, nn;
- int utf8 =
fromcode && !ascii_strcasecmp(fromcode, "UTF-8")
;
+ int utf8 =
mime_which_token(fromcode, -1) == MIME_UTF_8
;
n = dlen;
for (;;) {
n = dlen;
for (;;) {
@@
-807,7
+807,7
@@
void rfc2047_decode(char **pd)
n -= m, s += m;
}
n -= m, s += m;
}
- if (
ascii_strcasecmp(AssumedCharset, "us-ascii")
) {
+ if (
mime_which_token(AssumedCharset, -1) == MIME_US_ASCII
) {
char *t;
t = p_dupstr(s, n);
char *t;
t = p_dupstr(s, n);