projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor clarification in mh-alias(5)
[mmh]
/
sbr
/
fmt_rfc2047.c
diff --git
a/sbr/fmt_rfc2047.c
b/sbr/fmt_rfc2047.c
index
dc123e5
..
faa3cc2
100644
(file)
--- a/
sbr/fmt_rfc2047.c
+++ b/
sbr/fmt_rfc2047.c
@@
-125,22
+125,25
@@
decode_rfc2047(char *str, char *dst, size_t dstlen)
if (!*pp)
continue;
if (!*pp)
continue;
+ *pp = '\0';
/* Check if character set can be handled natively */
/* Check if character set can be handled natively */
- if (!check_charset(startofmime, pp - startofmime)) {
+ if (!is_native_charset(startofmime)) {
#ifdef HAVE_ICONV
/* .. it can't. We'll use iconv then. */
#ifdef HAVE_ICONV
/* .. it can't. We'll use iconv then. */
- *pp = '\0';
cd = iconv_open(get_charset(), startofmime);
fromutf8 = !mh_strcasecmp(startofmime, "UTF-8");
*pp = '?';
cd = iconv_open(get_charset(), startofmime);
fromutf8 = !mh_strcasecmp(startofmime, "UTF-8");
*pp = '?';
- if (cd == (iconv_t)-1) continue;
+ if (cd == (iconv_t)-1)
+ continue;
use_iconv = 1;
#else
use_iconv = 1;
#else
+ *pp = '?';
continue;
#endif
}
continue;
#endif
}
+ *pp = '?';
startofmime = pp + 1;
/* Check for valid encoding type */
startofmime = pp + 1;
/* Check for valid encoding type */
@@
-243,14
+246,16
@@
decode_rfc2047(char *str, char *dst, size_t dstlen)
while (pp < endofmime) {
/* 6 + 2 bits */
while ((pp < endofmime) &&
while (pp < endofmime) {
/* 6 + 2 bits */
while ((pp < endofmime) &&
- ((c1 = char64(*pp)) == -1)) {
+ ((c1 = char64(*pp))
+ == -1)) {
pp++;
}
if (pp < endofmime) {
pp++;
}
while ((pp < endofmime) &&
pp++;
}
if (pp < endofmime) {
pp++;
}
while ((pp < endofmime) &&
- ((c2 = char64(*pp)) == -1)) {
+ ((c2 = char64(*pp))
+ == -1)) {
pp++;
}
if (pp < endofmime && c1 != -1 && c2 != -1) {
pp++;
}
if (pp < endofmime && c1 != -1 && c2 != -1) {
@@
-259,7
+264,8
@@
decode_rfc2047(char *str, char *dst, size_t dstlen)
}
/* 4 + 4 bits */
while ((pp < endofmime) &&
}
/* 4 + 4 bits */
while ((pp < endofmime) &&
- ((c3 = char64(*pp)) == -1)) {
+ ((c3 = char64(*pp))
+ == -1)) {
pp++;
}
if (pp < endofmime && c2 != -1 && c3 != -1) {
pp++;
}
if (pp < endofmime && c2 != -1 && c3 != -1) {
@@
-268,7
+274,8
@@
decode_rfc2047(char *str, char *dst, size_t dstlen)
}
/* 2 + 6 bits */
while ((pp < endofmime) &&
}
/* 2 + 6 bits */
while ((pp < endofmime) &&
- ((c4 = char64(*pp)) == -1)) {
+ ((c4 = char64(*pp))
+ == -1)) {
pp++;
}
if (pp < endofmime && c3 != -1 && c4 != -1) {
pp++;
}
if (pp < endofmime && c3 != -1 && c4 != -1) {