projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
we use glibc, and gconv. Don't need our own transcoding stuff, glibc does
[apps/madmutt.git]
/
lib-mime
/
rfc2047.c
diff --git
a/lib-mime/rfc2047.c
b/lib-mime/rfc2047.c
index
a4d3b19
..
a2629a9
100644
(file)
--- a/
lib-mime/rfc2047.c
+++ b/
lib-mime/rfc2047.c
@@
-69,9
+69,9
@@
convert_string(const char *from, const char *f, ssize_t flen,
obl = 4 * flen + 1;
ob = buf = p_new(char, obl);
obl = 4 * flen + 1;
ob = buf = p_new(char, obl);
- n = m
y
_iconv(cd, &f, &flen, &ob, &obl);
+ n = m
utt
_iconv(cd, &f, &flen, &ob, &obl);
- if (n < 0 || m
y
_iconv(cd, 0, 0, &ob, &obl) < 0) {
+ if (n < 0 || m
utt
_iconv(cd, 0, 0, &ob, &obl) < 0) {
int e = errno;
iconv_close(cd);
errno = e;
int e = errno;
iconv_close(cd);
errno = e;
@@
-100,7
+100,7
@@
char *mutt_choose_charset(const char *fromcode, const char *charsets,
const char *p = charsets;
while (*p) {
const char *p = charsets;
while (*p) {
- char cset[S
HORT_S
TRING];
+ char cset[STRING];
const char *q;
char *s;
ssize_t slen, n;
const char *q;
char *s;
ssize_t slen, n;
@@
-266,14
+266,14
@@
static size_t try_block(const char *d, ssize_t dlen,
ob = buf1;
ob = buf1;
- if (m
y
_iconv(cd, &ib, &ibl, &ob, &obl) < 0
- || m
y
_iconv(cd, 0, 0, &ob, &obl) < 0)
+ if (m
utt
_iconv(cd, &ib, &ibl, &ob, &obl) < 0
+ || m
utt
_iconv(cd, 0, 0, &ob, &obl) < 0)
{
assert (errno == E2BIG && ib > d);
iconv_close(cd);
return (ib - d == dlen) ? dlen : ib - d + 1;
}
{
assert (errno == E2BIG && ib > d);
iconv_close(cd);
return (ib - d == dlen) ? dlen : ib - d + 1;
}
- iconv_close
(cd);
+ iconv_close(cd);
} else {
if (dlen > obl)
return obl + 1;
} else {
if (dlen > obl)
return obl + 1;
@@
-331,10
+331,10
@@
encode_block(char *s, char *d, ssize_t dlen,
cd = mutt_iconv_open(tocode, fromcode, 0);
assert (cd != MUTT_ICONV_ERROR);
ib = d, ibl = dlen, ob = buf1, obl = sizeof(buf1) - m_strlen(tocode);
cd = mutt_iconv_open(tocode, fromcode, 0);
assert (cd != MUTT_ICONV_ERROR);
ib = d, ibl = dlen, ob = buf1, obl = sizeof(buf1) - m_strlen(tocode);
- n1 = m
y
_iconv(cd, &ib, &ibl, &ob, &obl);
- n2 = m
y
_iconv(cd, 0, 0, &ob, &obl);
+ n1 = m
utt
_iconv(cd, &ib, &ibl, &ob, &obl);
+ n2 = m
utt
_iconv(cd, 0, 0, &ob, &obl);
assert (n1 >= 0 && n2 >= 0);
assert (n1 >= 0 && n2 >= 0);
- iconv_close
(cd);
+ iconv_close(cd);
return (*encoder)(s, buf1, ob - buf1, tocode);
} else {
return (*encoder)(s, d, dlen, tocode);
return (*encoder)(s, buf1, ob - buf1, tocode);
} else {
return (*encoder)(s, d, dlen, tocode);
@@
-561,13
+561,13
@@
static void _rfc2047_encode_string(char **pd, int encode_specials, int col)
ssize_t elen;
const char *charsets;
ssize_t elen;
const char *charsets;
- if (!
C
harset || !*pd)
+ if (!
mod_cset.c
harset || !*pd)
return;
return;
- charsets = m_strisempty(
SendCharset) ? "UTF-8" : SendC
harset;
+ charsets = m_strisempty(
mod_cset.send_charset) ? "utf-8" : mod_cset.send_c
harset;
rfc2047_encode(*pd, m_strlen(*pd), col,
rfc2047_encode(*pd, m_strlen(*pd), col,
-
C
harset, charsets, &e, &elen,
+
mod_cset.c
harset, charsets, &e, &elen,
encode_specials ? RFC822Specials : NULL);
p_delete(pd);
encode_specials ? RFC822Specials : NULL);
p_delete(pd);
@@
-667,7
+667,7
@@
rfc2047_decode_word(char *d, size_t len, const char *p, const char *end)
*q = '\0';
if (*charset)
*q = '\0';
if (*charset)
- mutt_convert_string(&d0, charset,
C
harset, M_ICONV_HOOK_FROM);
+ mutt_convert_string(&d0, charset,
mod_cset.c
harset, M_ICONV_HOOK_FROM);
m_strcpy(d, len, d0);
p_delete(&d0);
return 0;
m_strcpy(d, len, d0);
p_delete(&d0);
return 0;
@@
-786,7
+786,7
@@
void rfc2047_decode(char **pd)
n -= m, s += m;
}
n -= m, s += m;
}
- if (mime_which_token(
AssumedC
harset, -1) == MIME_US_ASCII) {
+ if (mime_which_token(
mod_cset.assumed_c
harset, -1) == MIME_US_ASCII) {
char *t;
t = p_dupstr(s, n);
char *t;
t = p_dupstr(s, n);