From 734f0a9402b4f7f66a36281fb577f3e47eaaa574 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 6 Oct 2000 17:59:39 +0000 Subject: Fix so that we don't encode every single char in the word. Also, do we 2000-10-06 Jeffrey Stedfast * camel-mime-utils.c (quoted_encode): Fix so that we don't encode every single char in the word. Also, do we need a safemask? I don't see why we would. svn path=/trunk/; revision=5765 --- camel/ChangeLog | 6 ++++++ camel/camel-mime-utils.c | 25 +++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index a6df9552a8..37ba9b0de7 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2000-10-06 Jeffrey Stedfast + + * camel-mime-utils.c (quoted_encode): Fix so that we don't encode + every single char in the word. Also, do we need a safemask? I + don't see why we would. + 2000-10-06 Chris Toshok * providers/nntp/Makefile.am (libcamelnntpinclude_HEADERS): add diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c index d8f10672ac..3ddc8abf74 100644 --- a/camel/camel-mime-utils.c +++ b/camel/camel-mime-utils.c @@ -789,6 +789,7 @@ quoted_decode(const unsigned char *in, int len, unsigned char *out) /* rfc2047 version of quoted-printable */ /* safemask is the mask to apply to the camel_mime_special_table to determine what characters can safely be included without encoding */ +/* Why do we need a 'safemask'? we always want to encode the same. */ static int quoted_encode(const unsigned char *in, int len, unsigned char *out, unsigned short safemask) { @@ -797,25 +798,25 @@ quoted_encode(const unsigned char *in, int len, unsigned char *out, unsigned sho unsigned char c; inptr = in; - inend = in+len; + inend = in + len; outptr = out; - while (inptr>4) & 0xf]; + *outptr++ = tohex[(c >> 4) & 0xf]; *outptr++ = tohex[c & 0xf]; } } - printf("encoding '%.*s' = '%.*s'\n", len, in, outptr-out, out); + d(printf("encoding '%.*s' = '%.*s'\n", len, in, outptr-out, out)); - return outptr-out; + return (outptr - out); } @@ -1177,9 +1178,9 @@ header_encode_string(const unsigned char *in) } start = inptr; encoding = 0; - } else if (c>127 && c < 256) { + } else if (c > 127 && c < 256) { encoding = MAX(encoding, 1); - } else if (c >=256) { + } else if (c >= 256) { encoding = MAX(encoding, 2); } } -- cgit v1.2.3