1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Pass the codepage (cp) instead of options to the scan_http_equiv.

This commit is contained in:
Witold Filipczyk 2009-01-27 09:23:56 +01:00 committed by Witold Filipczyk
parent 39c6589edb
commit d91668b0c5
4 changed files with 17 additions and 11 deletions

View File

@ -777,7 +777,9 @@ get_image_map(unsigned char *head, unsigned char *pos, unsigned char *eof,
if (!init_string(&hd)) return -1;
if (head) add_to_string(&hd, head);
scan_http_equiv(pos, eof, &hd, NULL, options);
/* FIXME (bug 784): cp is the terminal charset;
* should use the document charset instead. */
scan_http_equiv(pos, eof, &hd, NULL, options->cp);
ct = get_convert_table(hd.source, to, def, NULL, NULL, hdef);
done_string(&hd);
@ -897,7 +899,9 @@ init_html_parser(struct uri *uri, struct document_options *options,
html_context->options = options;
scan_http_equiv(start, end, head, title, options);
/* FIXME (bug 784): cp is the terminal charset;
* should use the document charset instead. */
scan_http_equiv(start, end, head, title, options->cp);
e = mem_calloc(1, sizeof(*e));
if (!e) return NULL;

View File

@ -453,7 +453,9 @@ html_handle_body_meta(struct html_context *html_context, unsigned char *meta,
if (!init_string(&head)) return;
scan_http_equiv(meta, eof, &head, NULL, html_context->options);
/* FIXME (bug 784): cp is the terminal charset;
* should use the document charset instead. */
scan_http_equiv(meta, eof, &head, NULL, html_context->options->cp);
process_head(html_context, head.source);
done_string(&head);
}

View File

@ -1163,7 +1163,7 @@ process_element(unsigned char *name, int namelen, int endingtag,
void
scan_http_equiv(unsigned char *s, unsigned char *eof, struct string *head,
struct string *title, struct document_options *options)
struct string *title, int cp)
{
unsigned char *name, *attr, *he, *c;
int namelen;
@ -1213,26 +1213,26 @@ xsp:
}
if (c_strlcasecmp(name, namelen, "META", 4)) goto se;
/* FIXME (bug 784): options->cp is the terminal charset;
/* FIXME (bug 784): cp is the terminal charset;
* should use the document charset instead. */
he = get_attr_val(attr, "charset", options->cp);
he = get_attr_val(attr, "charset", cp);
if (he) {
add_to_string(head, "Charset: ");
add_to_string(head, he);
mem_free(he);
}
/* FIXME (bug 784): options->cp is the terminal charset;
/* FIXME (bug 784): cp is the terminal charset;
* should use the document charset instead. */
he = get_attr_val(attr, "http-equiv", options->cp);
he = get_attr_val(attr, "http-equiv", cp);
if (!he) goto se;
add_to_string(head, he);
mem_free(he);
/* FIXME (bug 784): options->cp is the terminal charset;
/* FIXME (bug 784): cp is the terminal charset;
* should use the document charset instead. */
c = get_attr_val(attr, "content", options->cp);
c = get_attr_val(attr, "content", cp);
if (c) {
add_to_string(head, ": ");
add_to_string(head, c);

View File

@ -66,7 +66,7 @@ int get_width(unsigned char *, unsigned char *, int, struct html_context *);
unsigned char *skip_comment(unsigned char *, unsigned char *);
void scan_http_equiv(unsigned char *s, unsigned char *eof, struct string *head, struct string *title, struct document_options *options);
void scan_http_equiv(unsigned char *s, unsigned char *eof, struct string *head, struct string *title, int cp);
int supports_html_media_attr(const unsigned char *media);