diff --git a/AUTHORS b/AUTHORS index 3c0898ce..0b4b5f15 100644 --- a/AUTHORS +++ b/AUTHORS @@ -351,6 +351,10 @@ M. K. Srikant M. Levinson Python scripting fixes +M. Vefa Bicakci + Licenses modifications under "GPL version 2 or any later version." + Locale-independent case-insensitive comparisons + Malcolm Parsons Typo fixes diff --git a/NEWS b/NEWS index 2a95f44d..3b4b5c57 100644 --- a/NEWS +++ b/NEWS @@ -301,6 +301,9 @@ To be released as 0.11.6. * critical bug 1053: fix crash if a download finishes after ELinks has closed the terminal from which the download was started +* major bug 1004: ignore locales when comparing HTML element names and + similar strings, so e.g. ``title'' matches ``TITLE'' even in the + Turkish locale ELinks 0.11.5: -------------- diff --git a/src/bookmarks/dialogs.c b/src/bookmarks/dialogs.c index 2e66a035..cbd901f5 100644 --- a/src/bookmarks/dialogs.c +++ b/src/bookmarks/dialogs.c @@ -556,7 +556,7 @@ test_search(struct listbox_item *item, void *data_, int *offset) assert(ctx->title && ctx->url); ctx->found = (*ctx->title && strcasestr(bm->title, ctx->title)) - || (*ctx->url && strcasestr(bm->url, ctx->url)); + || (*ctx->url && c_strcasestr(bm->url, ctx->url)); if (ctx->found) *offset = 0; } diff --git a/src/cache/dialogs.c b/src/cache/dialogs.c index 9d60548f..55da14a6 100644 --- a/src/cache/dialogs.c +++ b/src/cache/dialogs.c @@ -193,8 +193,8 @@ match_cache_entry(struct listbox_item *item, struct terminal *term, { struct cache_entry *cached = item->udata; - if (strcasestr(struri(cached->uri), text) - || (cached->head && strcasestr(cached->head, text))) + if (c_strcasestr(struri(cached->uri), text) + || (cached->head && c_strcasestr(cached->head, text))) return LISTBOX_MATCH_OK; return LISTBOX_MATCH_NO; diff --git a/src/config/cmdline.c b/src/config/cmdline.c index 4565b138..b5263235 100644 --- a/src/config/cmdline.c +++ b/src/config/cmdline.c @@ -321,7 +321,7 @@ remote_cmd(struct option *o, unsigned char ***argv, int *argc) for (method = 0; remote_methods[method].name; method++) { unsigned char *name = remote_methods[method].name; - if (!strlcasecmp(command, len, name, -1)) + if (!c_strlcasecmp(command, len, name, -1)) break; } @@ -359,7 +359,7 @@ remote_cmd(struct option *o, unsigned char ***argv, int *argc) if (remote_argc < 1) break; - if (!strcasecmp(remote_argv[0], "openBrowser")) { + if (!c_strcasecmp(remote_argv[0], "openBrowser")) { remote_session_flags = SES_REMOTE_NEW_WINDOW; } break; @@ -450,7 +450,7 @@ print_full_help_inner(struct option *tree, unsigned char *path, || (option->flags & OPT_HIDDEN)) continue; - if (!capt && !strncasecmp(option->name, "_template_", 10)) + if (!capt && !c_strncasecmp(option->name, "_template_", 10)) capt = (unsigned char *) N_("Template option folder"); if (!capt) { diff --git a/src/config/kbdbind.c b/src/config/kbdbind.c index ed9f5719..2096a56d 100644 --- a/src/config/kbdbind.c +++ b/src/config/kbdbind.c @@ -18,6 +18,7 @@ #include "main/event.h" #include "main/module.h" #include "terminal/kbd.h" +#include "util/conv.h" #include "util/memory.h" #include "util/string.h" @@ -363,7 +364,7 @@ read_key(const unsigned char *key_str) return key_str[0]; for (key = key_table; key->str; key++) - if (!strcasecmp(key->str, key_str)) + if (!c_strcasecmp(key->str, key_str)) return key->num; return KBD_UNDEF; @@ -380,17 +381,17 @@ parse_keystroke(const unsigned char *s, struct term_event_keyboard *kbd) { kbd->modifier = KBD_MOD_NONE; while (1) { - if (!strncasecmp(s, "Shift", 5) && (s[5] == '-' || s[5] == '+')) { + if (!c_strncasecmp(s, "Shift", 5) && (s[5] == '-' || s[5] == '+')) { /* Shift+a == shiFt-a == Shift-a */ kbd->modifier |= KBD_MOD_SHIFT; s += 6; - } else if (!strncasecmp(s, "Ctrl", 4) && (s[4] == '-' || s[4] == '+')) { + } else if (!c_strncasecmp(s, "Ctrl", 4) && (s[4] == '-' || s[4] == '+')) { /* Ctrl+a == ctRl-a == Ctrl-a */ kbd->modifier |= KBD_MOD_CTRL; s += 5; - } else if (!strncasecmp(s, "Alt", 3) && (s[3] == '-' || s[3] == '+')) { + } else if (!c_strncasecmp(s, "Alt", 3) && (s[3] == '-' || s[3] == '+')) { /* Alt+a == aLt-a == Alt-a */ kbd->modifier |= KBD_MOD_ALT; s += 4; @@ -430,7 +431,7 @@ parse_keystroke(const unsigned char *s, struct term_event_keyboard *kbd) * and instead make kbd_ev_lookup() or its callers * search for different variants of the keystroke if * the original one is not bound to any action. */ - kbd->key = toupper(kbd->key); + kbd->key = c_toupper(kbd->key); } return (kbd->key == KBD_UNDEF) ? -1 : 0; diff --git a/src/cookies/cookies.c b/src/cookies/cookies.c index d7caa25f..0c7059dd 100644 --- a/src/cookies/cookies.c +++ b/src/cookies/cookies.c @@ -143,7 +143,7 @@ get_cookie_server(unsigned char *host, int hostlen) /* XXX: We must count with cases like "x.co" vs "x.co.uk" * below! */ int cslen = strlen(cs->host); - int cmp = strncasecmp(cs->host, host, hostlen); + int cmp = c_strncasecmp(cs->host, host, hostlen); if (!sort_spot && (cmp > 0 || (cmp == 0 && cslen > hostlen))) { /* This is the first @cs with name greater than @host, @@ -234,13 +234,13 @@ is_domain_security_ok(unsigned char *domain, unsigned char *server, int server_l /* Match domain and server.. */ - /* XXX: Hmm, can't we use strlcasecmp() here? --pasky */ + /* XXX: Hmm, can't we use c_strlcasecmp() here? --pasky */ if (domain_len > server_len) return 0; /* Ensure that the domain is atleast a substring of the server before * continuing. */ - if (strncasecmp(domain, server + server_len - domain_len, domain_len)) + if (c_strncasecmp(domain, server + server_len - domain_len, domain_len)) return 0; /* Allow domains which are same as servers. -- */ @@ -499,8 +499,8 @@ accept_cookie(struct cookie *cookie) struct cookie *c, *next; foreachsafe (c, next, cookies) { - if (strcasecmp(c->name, cookie->name) - || strcasecmp(c->domain, cookie->domain)) + if (c_strcasecmp(c->name, cookie->name) + || c_strcasecmp(c->domain, cookie->domain)) continue; delete_cookie(c); @@ -513,7 +513,7 @@ accept_cookie(struct cookie *cookie) /* XXX: This crunches CPU too. --pasky */ foreach (cd, c_domains) - if (!strcasecmp(cd->domain, cookie->domain)) + if (!c_strcasecmp(cd->domain, cookie->domain)) return; domain_len = strlen(cookie->domain); @@ -535,11 +535,11 @@ delete_cookie(struct cookie *c) struct cookie *d; foreach (d, cookies) - if (!strcasecmp(d->domain, c->domain)) + if (!c_strcasecmp(d->domain, c->domain)) goto end; foreach (cd, c_domains) { - if (!strcasecmp(cd->domain, c->domain)) { + if (!c_strcasecmp(cd->domain, c->domain)) { del_from_list(cd); mem_free(cd); break; diff --git a/src/document/css/scanner.c b/src/document/css/scanner.c index 767c6643..fd9057e6 100644 --- a/src/document/css/scanner.c +++ b/src/document/css/scanner.c @@ -287,7 +287,7 @@ scan_css_token(struct scanner *scanner, struct scanner_token *token) } else if (first_char == '!') { scan_css(scanner, string, CSS_CHAR_WHITESPACE); - if (!strncasecmp(string, "important", 9)) { + if (!c_strncasecmp(string, "important", 9)) { type = CSS_TOKEN_IMPORTANT; string += 9; } diff --git a/src/document/css/stylesheet.c b/src/document/css/stylesheet.c index 7cdd14a6..892f0c5c 100644 --- a/src/document/css/stylesheet.c +++ b/src/document/css/stylesheet.c @@ -38,7 +38,7 @@ find_css_selector(struct css_selector_set *sels, foreach_css_selector (selector, sels) { if (type != selector->type || rel != selector->relation) continue; - if (strlcasecmp(name, namelen, selector->name, -1)) + if (c_strlcasecmp(name, namelen, selector->name, -1)) continue; return selector; } diff --git a/src/document/document.c b/src/document/document.c index c7337d5d..5424f6fb 100644 --- a/src/document/document.c +++ b/src/document/document.c @@ -191,7 +191,7 @@ find_tag(struct document *document, unsigned char *name, int namelen) struct tag *tag; foreach (tag, document->tags) - if (!strlcasecmp(tag->name, -1, name, namelen)) + if (!c_strlcasecmp(tag->name, -1, name, namelen)) return tag->y; return -1; diff --git a/src/document/dom/renderer.c b/src/document/dom/renderer.c index c20d2a4a..32484dad 100644 --- a/src/document/dom/renderer.c +++ b/src/document/dom/renderer.c @@ -54,22 +54,22 @@ done_dom_renderer(struct dom_renderer *renderer) static void get_doctype(struct dom_renderer *renderer, struct cache_entry *cached) { - if (!strcasecmp("application/rss+xml", cached->content_type)) { + if (!c_strcasecmp("application/rss+xml", cached->content_type)) { renderer->doctype = SGML_DOCTYPE_RSS; - } else if (!strcasecmp("application/docbook+xml", - cached->content_type)) { + } else if (!c_strcasecmp("application/docbook+xml", + cached->content_type)) { renderer->doctype = SGML_DOCTYPE_DOCBOOK; - } else if (!strcasecmp("application/xbel+xml", cached->content_type) - || !strcasecmp("application/x-xbel", cached->content_type) - || !strcasecmp("application/xbel", cached->content_type)) { + } else if (!c_strcasecmp("application/xbel+xml", cached->content_type) + || !c_strcasecmp("application/x-xbel", cached->content_type) + || !c_strcasecmp("application/xbel", cached->content_type)) { renderer->doctype = SGML_DOCTYPE_XBEL; } else { - assertm(!strcasecmp("text/html", cached->content_type) - || !strcasecmp("application/xhtml+xml", - cached->content_type), + assertm(!c_strcasecmp("text/html", cached->content_type) + || !c_strcasecmp("application/xhtml+xml", + cached->content_type), "Couldn't resolve doctype '%s'", cached->content_type); renderer->doctype = SGML_DOCTYPE_HTML; diff --git a/src/document/html/frames.c b/src/document/html/frames.c index a06af548..3c40db7f 100644 --- a/src/document/html/frames.c +++ b/src/document/html/frames.c @@ -137,7 +137,7 @@ find_fd(struct session *ses, unsigned char *name, foreachback (doc_view, ses->scrn_frames) { if (doc_view->used) continue; - if (strcasecmp(doc_view->name, name)) continue; + if (c_strcasecmp(doc_view->name, name)) continue; doc_view->used = 1; doc_view->depth = depth; diff --git a/src/document/html/parser.c b/src/document/html/parser.c index ecafb631..c95e3792 100644 --- a/src/document/html/parser.c +++ b/src/document/html/parser.c @@ -94,7 +94,7 @@ get_target(struct document_options *options, unsigned char *a) if (!v) return NULL; - if (!*v || !strcasecmp(v, "_self")) { + if (!*v || !c_strcasecmp(v, "_self")) { mem_free_set(&v, stracpy(options->framename)); } @@ -341,7 +341,7 @@ search_for_url_param(unsigned char *str, unsigned char **ret) /* Returns now if string @str is empty. */ if (!*str) return HEADER_PARAM_NOT_FOUND; - p = strcasestr(str, "url"); + p = c_strcasestr(str, "url"); if (!p) return HEADER_PARAM_NOT_FOUND; p += 3; @@ -551,7 +551,7 @@ look_for_map(unsigned char **pos, unsigned char *eof, struct uri *uri, return 1; } - if (strlcasecmp(name, namelen, "MAP", 3)) return 1; + if (c_strlcasecmp(name, namelen, "MAP", 3)) return 1; if (uri && uri->fragment) { /* FIXME (bug 784): options->cp is the terminal charset; @@ -559,7 +559,7 @@ look_for_map(unsigned char **pos, unsigned char *eof, struct uri *uri, al = get_attr_val(attr, "name", options->cp); if (!al) return 1; - if (strlcasecmp(al, -1, uri->fragment, uri->fragmentlen)) { + if (c_strlcasecmp(al, -1, uri->fragment, uri->fragmentlen)) { mem_free(al); return 1; } @@ -606,12 +606,12 @@ look_for_tag(unsigned char **pos, unsigned char *eof, if (parse_element(*pos, eof, NULL, NULL, NULL, &pos2)) return 1; - if (strlcasecmp(name, namelen, "A", 1) - && strlcasecmp(name, namelen, "/A", 2) - && strlcasecmp(name, namelen, "MAP", 3) - && strlcasecmp(name, namelen, "/MAP", 4) - && strlcasecmp(name, namelen, "AREA", 4) - && strlcasecmp(name, namelen, "/AREA", 5)) { + if (c_strlcasecmp(name, namelen, "A", 1) + && c_strlcasecmp(name, namelen, "/A", 2) + && c_strlcasecmp(name, namelen, "MAP", 3) + && c_strlcasecmp(name, namelen, "/MAP", 4) + && c_strlcasecmp(name, namelen, "AREA", 4) + && c_strlcasecmp(name, namelen, "/AREA", 5)) { *pos = pos2; return 1; } @@ -648,12 +648,12 @@ look_for_link(unsigned char **pos, unsigned char *eof, struct menu_item **menu, return 1; } - if (!strlcasecmp(name, namelen, "A", 1)) { + if (!c_strlcasecmp(name, namelen, "A", 1)) { while (look_for_tag(pos, eof, name, namelen, &label)); if (*pos >= eof) return 0; - } else if (!strlcasecmp(name, namelen, "AREA", 4)) { + } else if (!c_strlcasecmp(name, namelen, "AREA", 4)) { /* FIXME (bug 784): options->cp is the terminal charset; * should use the document charset instead. */ unsigned char *alt = get_attr_val(attr, "alt", options->cp); @@ -667,7 +667,7 @@ look_for_link(unsigned char **pos, unsigned char *eof, struct menu_item **menu, label = NULL; } - } else if (!strlcasecmp(name, namelen, "/MAP", 4)) { + } else if (!c_strlcasecmp(name, namelen, "/MAP", 4)) { /* This is the only successful return from here! */ add_to_ml(ml, (void *) *menu, (void *) NULL); return 0; diff --git a/src/document/html/parser/forms.c b/src/document/html/parser/forms.c index 1a717a8b..c34459a1 100644 --- a/src/document/html/parser/forms.c +++ b/src/document/html/parser/forms.c @@ -52,7 +52,7 @@ html_form(struct html_context *html_context, unsigned char *a, al = get_attr_val(a, "method", html_context->doc_cp); if (al) { - if (!strcasecmp(al, "post")) { + if (!c_strcasecmp(al, "post")) { unsigned char *enctype; enctype = get_attr_val(a, "enctype", @@ -60,9 +60,9 @@ html_form(struct html_context *html_context, unsigned char *a, form->method = FORM_METHOD_POST; if (enctype) { - if (!strcasecmp(enctype, "multipart/form-data")) + if (!c_strcasecmp(enctype, "multipart/form-data")) form->method = FORM_METHOD_POST_MP; - else if (!strcasecmp(enctype, "text/plain")) + else if (!c_strcasecmp(enctype, "text/plain")) form->method = FORM_METHOD_POST_TEXT_PLAIN; mem_free(enctype); } @@ -153,11 +153,11 @@ html_button(struct html_context *html_context, unsigned char *a, al = get_attr_val(a, "type", cp); if (!al) goto no_type_attr; - if (!strcasecmp(al, "button")) { + if (!c_strcasecmp(al, "button")) { type = FC_BUTTON; - } else if (!strcasecmp(al, "reset")) { + } else if (!c_strcasecmp(al, "reset")) { type = FC_RESET; - } else if (strcasecmp(al, "submit")) { + } else if (c_strcasecmp(al, "submit")) { /* unknown type */ mem_free(al); return; @@ -273,16 +273,16 @@ html_input(struct html_context *html_context, unsigned char *a, al = get_attr_val(a, "type", cp); if (al) { - if (!strcasecmp(al, "text")) fc->type = FC_TEXT; - else if (!strcasecmp(al, "hidden")) fc->type = FC_HIDDEN; - else if (!strcasecmp(al, "button")) fc->type = FC_BUTTON; - else if (!strcasecmp(al, "checkbox")) fc->type = FC_CHECKBOX; - else if (!strcasecmp(al, "radio")) fc->type = FC_RADIO; - else if (!strcasecmp(al, "password")) fc->type = FC_PASSWORD; - else if (!strcasecmp(al, "submit")) fc->type = FC_SUBMIT; - else if (!strcasecmp(al, "reset")) fc->type = FC_RESET; - else if (!strcasecmp(al, "file")) fc->type = FC_FILE; - else if (!strcasecmp(al, "image")) fc->type = FC_IMAGE; + if (!c_strcasecmp(al, "text")) fc->type = FC_TEXT; + else if (!c_strcasecmp(al, "hidden")) fc->type = FC_HIDDEN; + else if (!c_strcasecmp(al, "button")) fc->type = FC_BUTTON; + else if (!c_strcasecmp(al, "checkbox")) fc->type = FC_CHECKBOX; + else if (!c_strcasecmp(al, "radio")) fc->type = FC_RADIO; + else if (!c_strcasecmp(al, "password")) fc->type = FC_PASSWORD; + else if (!c_strcasecmp(al, "submit")) fc->type = FC_SUBMIT; + else if (!c_strcasecmp(al, "reset")) fc->type = FC_RESET; + else if (!c_strcasecmp(al, "file")) fc->type = FC_FILE; + else if (!c_strcasecmp(al, "image")) fc->type = FC_IMAGE; /* else unknown type, let it default to FC_TEXT. */ mem_free(al); } @@ -408,12 +408,12 @@ abort: closing_tag = 0; } - if (closing_tag && !strlcasecmp(name, namelen, "SELECT", 6)) { + if (closing_tag && !c_strlcasecmp(name, namelen, "SELECT", 6)) { add_select_item(&lnk_menu, &lbl, &orig_lbl, values, order, nnmi); goto end_parse; } - if (!strlcasecmp(name, namelen, "OPTION", 6)) { + if (!c_strlcasecmp(name, namelen, "OPTION", 6)) { add_select_item(&lnk_menu, &lbl, &orig_lbl, values, order, nnmi); if (!closing_tag) { @@ -442,7 +442,7 @@ abort: goto see; } - if (!strlcasecmp(name, namelen, "OPTGROUP", 8)) { + if (!c_strlcasecmp(name, namelen, "OPTGROUP", 8)) { add_select_item(&lnk_menu, &lbl, &orig_lbl, values, order, nnmi); if (group) new_menu_item(&lnk_menu, NULL, -1, 0), group = 0; @@ -586,10 +586,10 @@ sp: if (namelen < 6) goto se; if (name[0] == '/') name++, namelen--; - - if (strlcasecmp(name, namelen, "OPTION", 6) - && strlcasecmp(name, namelen, "SELECT", 6) - && strlcasecmp(name, namelen, "OPTGROUP", 8)) + + if (c_strlcasecmp(name, namelen, "OPTION", 6) + && c_strlcasecmp(name, namelen, "SELECT", 6) + && c_strlcasecmp(name, namelen, "OPTGROUP", 8)) goto se; } @@ -641,7 +641,7 @@ pp: return; } if (parse_element(p, eof, &t_name, &t_namelen, NULL, end)) goto pp; - if (strlcasecmp(t_name, t_namelen, "/TEXTAREA", 9)) goto pp; + if (c_strlcasecmp(t_name, t_namelen, "/TEXTAREA", 9)) goto pp; fc = init_form_control(FC_TEXTAREA, attr, html_context); if (!fc) return; @@ -684,14 +684,14 @@ pp: wrap_attr = get_attr_val(attr, "wrap", html_context->doc_cp); if (wrap_attr) { - if (!strcasecmp(wrap_attr, "hard") - || !strcasecmp(wrap_attr, "physical")) { + if (!c_strcasecmp(wrap_attr, "hard") + || !c_strcasecmp(wrap_attr, "physical")) { fc->wrap = FORM_WRAP_HARD; - } else if (!strcasecmp(wrap_attr, "soft") - || !strcasecmp(wrap_attr, "virtual")) { + } else if (!c_strcasecmp(wrap_attr, "soft") + || !c_strcasecmp(wrap_attr, "virtual")) { fc->wrap = FORM_WRAP_SOFT; - } else if (!strcasecmp(wrap_attr, "none") - || !strcasecmp(wrap_attr, "off")) { + } else if (!c_strcasecmp(wrap_attr, "none") + || !c_strcasecmp(wrap_attr, "off")) { fc->wrap = FORM_WRAP_NONE; } mem_free(wrap_attr); diff --git a/src/document/html/parser/general.c b/src/document/html/parser/general.c index d5dfdeb5..bbb64daf 100644 --- a/src/document/html/parser/general.c +++ b/src/document/html/parser/general.c @@ -227,10 +227,10 @@ html_script(struct html_context *html_context, unsigned char *a, if (type) { unsigned char *pos = type; - if (!strncasecmp(type, "text/", 5)) { + if (!c_strncasecmp(type, "text/", 5)) { pos += 5; - } else if (!strncasecmp(type, "application/", 12)) { + } else if (!c_strncasecmp(type, "application/", 12)) { pos += 12; } else { @@ -241,7 +241,7 @@ not_processed: return; } - if (!strncasecmp(pos, "javascript", 10)) { + if (!c_strncasecmp(pos, "javascript", 10)) { int len = strlen(pos); if (len > 10 && !isdigit(pos[10])) { @@ -249,11 +249,11 @@ not_processed: goto not_processed; } - } else if (strcasecmp(pos, "ecmascript") - && strcasecmp(pos, "jscript") - && strcasecmp(pos, "livescript") - && strcasecmp(pos, "x-javascript") - && strcasecmp(pos, "x-ecmascript")) { + } else if (c_strcasecmp(pos, "ecmascript") + && c_strcasecmp(pos, "jscript") + && c_strcasecmp(pos, "livescript") + && c_strcasecmp(pos, "x-javascript") + && c_strcasecmp(pos, "x-ecmascript")) { mem_free(type); goto not_processed; } @@ -271,7 +271,7 @@ not_processed: if (languagelen < 10 || (languagelen > 10 && !isdigit(language[10])) - || strncasecmp(language, "javascript", 10)) { + || c_strncasecmp(language, "javascript", 10)) { mem_free(language); goto not_processed; } @@ -372,7 +372,7 @@ imported: * argument. */ if (parse_element(*end, eof, &name, &namelen, NULL, NULL)) continue; - if (strlcasecmp(name, namelen, "/script", 7)) + if (c_strlcasecmp(name, namelen, "/script", 7)) continue; /* We have won! */ break; @@ -482,13 +482,13 @@ html_linebrk(struct html_context *html_context, unsigned char *a, unsigned char *al = get_attr_val(a, "align", html_context->doc_cp); if (al) { - if (!strcasecmp(al, "left")) par_format.align = ALIGN_LEFT; - else if (!strcasecmp(al, "right")) par_format.align = ALIGN_RIGHT; - else if (!strcasecmp(al, "center")) { + if (!c_strcasecmp(al, "left")) par_format.align = ALIGN_LEFT; + else if (!c_strcasecmp(al, "right")) par_format.align = ALIGN_RIGHT; + else if (!c_strcasecmp(al, "center")) { par_format.align = ALIGN_CENTER; if (!html_context->table_level) par_format.leftmargin = par_format.rightmargin = 0; - } else if (!strcasecmp(al, "justify")) par_format.align = ALIGN_JUSTIFY; + } else if (!c_strcasecmp(al, "justify")) par_format.align = ALIGN_JUSTIFY; mem_free(al); } } @@ -745,9 +745,9 @@ html_ul(struct html_context *html_context, unsigned char *a, al = get_attr_val(a, "type", html_context->doc_cp); if (al) { - if (!strcasecmp(al, "disc") || !strcasecmp(al, "circle")) + if (!c_strcasecmp(al, "disc") || !c_strcasecmp(al, "circle")) par_format.flags = P_O; - else if (!strcasecmp(al, "square")) + else if (!c_strcasecmp(al, "square")) par_format.flags = P_PLUS; mem_free(al); } @@ -893,7 +893,7 @@ html_li(struct html_context *html_context, unsigned char *a, if (t == P_ROMAN) { unsigned char *x; - for (x = n; *x; x++) *x = toupper(*x); + for (x = n; *x; x++) *x = c_toupper(*x); } } else { diff --git a/src/document/html/parser/link.c b/src/document/html/parser/link.c index bfbe1b22..d203037e 100644 --- a/src/document/html/parser/link.c +++ b/src/document/html/parser/link.c @@ -463,12 +463,12 @@ html_object(struct html_context *html_context, unsigned char *a, type = get_attr_val(a, "type", html_context->doc_cp); if (!type) { mem_free(url); return; } - if (!strncasecmp(type, "text/", 5)) { + if (!c_strncasecmp(type, "text/", 5)) { /* We will just emulate