From b88f6b9593ad0a6fda85ca8d01b623583f714bcc Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 12 Jul 2001 05:02:11 +0000 Subject: Removed. (check_html_charset): Replaced with this. 2001-07-12 Not Zed * camel-mime-part-utils.c (extract_metatag_charset): Removed. (check_html_charset): Replaced with this. (simple_data_wrapper_construct_from_parser): Call check_html_charset if we dont have a charset on the content-type, and we have text/html data. (check_html_charset): We also need to do qp/base64 decoding ourselves, sigh. * camel-mime-utils.c (html_meta_param_list_decode): Removed. This was very wrong, the rules for mail headers vastly different from rules for decoding html elements. (rfc2184_decode): Move the malloc inside the iconv_open worked, otherwise we have a memleak. * camel-mime-filter-html.c (camel_mime_filter_html_finalize, init, run, reset): Changed to use camelhtmlparser, and fixed a tiny memleak. * camel-html-parser.c: Made the html indexer tokeniser re-usable. ONLY TO BE USED INTERNAL TO CAMEL HOWEVER. (tokenise_step): Slight fix to non-quoted values. svn path=/trunk/; revision=11028 --- camel/camel-mime-utils.c | 73 +++++++----------------------------------------- 1 file changed, 10 insertions(+), 63 deletions(-) (limited to 'camel/camel-mime-utils.c') diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c index eb228cd748..f051c0d596 100644 --- a/camel/camel-mime-utils.c +++ b/camel/camel-mime-utils.c @@ -903,7 +903,7 @@ rfc2047_decode_word(const char *in, int len) { const char *inptr = in+2; const char *inend = in+len-2; - char *inbuf; + const char *inbuf; char *encname; int tmplen; int ret; @@ -1150,7 +1150,7 @@ rfc2047_encode_word(GString *outstring, const char *in, int len, const char *typ iconv_t ic = (iconv_t *)-1; char *buffer, *out, *ascii; size_t inlen, outlen, enclen, bufflen; - char *inptr, *p; + const char *inptr, *p; int first = 1; d(printf("Converting [%d] '%.*s' to %s\n", len, len, in, type)); @@ -1159,7 +1159,7 @@ rfc2047_encode_word(GString *outstring, const char *in, int len, const char *typ bufflen = len*6+16; buffer = alloca(bufflen); inlen = len; - inptr = (char *) in; + inptr = in; ascii = alloca(bufflen); @@ -1808,20 +1808,21 @@ rfc2184_decode (const char *in, int len) inptr++; if (inptr < inend) { - char *decword, *inbuf, *outbase, *outbuf; + char *decword, *outbase, *outbuf; + const char *inbuf; int inlen, outlen; iconv_t ic; inbuf = decword = hex_decode (inptr, inend - inptr); inlen = strlen (inbuf); - - outlen = inlen * 6 + 16; - outbuf = outbase = g_malloc (outlen); - + ic = iconv_open ("UTF-8", encoding); if (ic != (iconv_t) -1) { int ret; - + + outlen = inlen * 6 + 16; + outbuf = outbase = g_malloc (outlen); + ret = iconv (ic, &inbuf, &inlen, &outbuf, &outlen); if (ret >= 0) { iconv (ic, NULL, 0, &outbuf, &outlen); @@ -2720,60 +2721,6 @@ header_param_list_decode(const char *in) return header_decode_param_list(&in); } -struct _header_param * -html_meta_param_list_decode (const char *in, int inlen) -{ - /* example: */ - struct _header_param *params = NULL, *last = NULL; - const char *inptr, *inend; - - if (in == NULL) - return NULL; - - inptr = in; - inend = inptr + inlen; - - if (*inptr != '<') - return NULL; - - if (!g_strncasecmp (inptr, "next = NULL; - param->name = name; - param->value = value; - - if (last) { - last->next = param; - last = param; - } else { - last = params = param; - } - } - - return params; -} - /* FIXME: I wrote this in a quick & dirty fasion - it may not be 100% correct */ static char * header_encode_param (const unsigned char *in, gboolean *encoded) -- cgit v1.2.3