diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/netsurf.c | 9 | ||||
-rw-r--r-- | desktop/save_complete.c | 22 | ||||
-rw-r--r-- | desktop/tree_url_node.c | 13 |
3 files changed, 26 insertions, 18 deletions
diff --git a/desktop/netsurf.c b/desktop/netsurf.c index 4fa7134c0..d2010d80b 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -47,6 +47,7 @@ #include "render/html.h" #include "render/textplain.h" +#include "utils/corestrings.h" #include "utils/log.h" #include "utils/url.h" #include "utils/utf8.h" @@ -76,7 +77,7 @@ bool verbose_log = false; static void netsurf_lwc_iterator(lwc_string *str, void *pw) { - LOG(("%.*s", (int) lwc_string_length(str), lwc_string_data(str))); + LOG(("[%3u] %.*s", str->refcnt, (int) lwc_string_length(str), lwc_string_data(str))); } /** @@ -169,6 +170,11 @@ nserror netsurf_init(int *pargc, messages_load(messages); + /* corestrings init */ + error = corestrings_init(); + if (error != NSERROR_OK) + return error; + /* set up cache limits based on the memory cache size option */ hlcache_parameters.limit = nsoption_int(memory_cache_size); @@ -287,6 +293,7 @@ void netsurf_exit(void) LOG(("Destroying System colours")); gui_system_colour_finalize(); + corestrings_fini(); LOG(("Remaining lwc strings:")); lwc_iterate_strings(netsurf_lwc_iterator, NULL); diff --git a/desktop/save_complete.c b/desktop/save_complete.c index 33234ce2c..0ac64b515 100644 --- a/desktop/save_complete.c +++ b/desktop/save_complete.c @@ -589,28 +589,28 @@ bool rewrite_urls(xmlNode *n, const char *base, /* ignore */ } /* 1 */ - else if (strcmp((const char *) n->name, "object") == 0) { + else if (strcasecmp((const char *) n->name, "object") == 0) { if (!rewrite_url(n, "data", base, list)) return false; } /* 2 */ - else if (strcmp((const char *) n->name, "a") == 0 || - strcmp((const char *) n->name, "area") == 0 || - strcmp((const char *) n->name, "link") == 0) { + else if (strcasecmp((const char *) n->name, "a") == 0 || + strcasecmp((const char *) n->name, "area") == 0 || + strcasecmp((const char *) n->name, "link") == 0) { if (!rewrite_url(n, "href", base, list)) return false; } /* 3 */ - else if (strcmp((const char *) n->name, "frame") == 0 || - strcmp((const char *) n->name, "iframe") == 0 || - strcmp((const char *) n->name, "input") == 0 || - strcmp((const char *) n->name, "img") == 0 || - strcmp((const char *) n->name, "script") == 0) { + else if (strcasecmp((const char *) n->name, "frame") == 0 || + strcasecmp((const char *) n->name, "iframe") == 0 || + strcasecmp((const char *) n->name, "input") == 0 || + strcasecmp((const char *) n->name, "img") == 0 || + strcasecmp((const char *) n->name, "script") == 0) { if (!rewrite_url(n, "src", base, list)) return false; } /* 4 */ - else if (strcmp((const char *) n->name, "style") == 0) { + else if (strcasecmp((const char *) n->name, "style") == 0) { unsigned int len; xmlChar *content; @@ -642,7 +642,7 @@ bool rewrite_urls(xmlNode *n, const char *base, return true; } /* 5 */ - else if (strcmp((const char *) n->name, "base") == 0) { + else if (strcasecmp((const char *) n->name, "base") == 0) { /* simply remove any <base> tags from the document */ xmlUnlinkNode(n); xmlFreeNode(n); diff --git a/desktop/tree_url_node.c b/desktop/tree_url_node.c index 380ba43b9..d477249c9 100644 --- a/desktop/tree_url_node.c +++ b/desktop/tree_url_node.c @@ -470,7 +470,7 @@ static xmlNode *tree_url_find_xml_element(xmlNode *node, const char *name) for (xmlnode = node->children; xmlnode && !(xmlnode->type == XML_ELEMENT_NODE && - strcmp((const char *) xmlnode->name, name) == 0); + strcasecmp((const char *) xmlnode->name, name) == 0); xmlnode = xmlnode->next) ; @@ -498,7 +498,7 @@ static void tree_url_load_entry(xmlNode *li, struct tree *tree, for (xmlnode = li->children; xmlnode; xmlnode = xmlnode->next) { /* The li must contain an "a" element */ if (xmlnode->type == XML_ELEMENT_NODE && - strcmp((const char *)xmlnode->name, "a") == 0) { + strcasecmp((const char *)xmlnode->name, "a") == 0) { url1 = (char *)xmlGetProp(xmlnode, (const xmlChar *) "href"); title = (char *)xmlNodeGetContent(xmlnode); @@ -590,12 +590,12 @@ static void tree_url_load_directory(xmlNode *ul, struct tree *tree, if (xmlnode->type != XML_ELEMENT_NODE) continue; - if (strcmp((const char *)xmlnode->name, "li") == 0) { + if (strcasecmp((const char *)xmlnode->name, "li") == 0) { /* entry */ tree_url_load_entry(xmlnode, tree, directory, callback, callback_data); - } else if (strcmp((const char *)xmlnode->name, "h4") == 0) { + } else if (strcasecmp((const char *)xmlnode->name, "h4") == 0) { /* directory */ bool dir_is_default = false; title = (char *) xmlNodeGetContent(xmlnode ); @@ -610,7 +610,7 @@ static void tree_url_load_directory(xmlNode *ul, struct tree *tree, xmlnode = xmlnode->next) ; if ((xmlnode == NULL) || - strcmp((const char *)xmlnode->name, "ul") != 0) { + strcasecmp((const char *)xmlnode->name, "ul") != 0) { /* next element isn't expected ul */ free(title); warn_user("TreeLoadError", "(Expected " @@ -620,7 +620,8 @@ static void tree_url_load_directory(xmlNode *ul, struct tree *tree, id = xmlGetProp(xmlnode, (const xmlChar *) "id"); if (id != NULL) { - if(strcmp((const char *)id, "default") == 0) + if (strcasecmp((const char *)id, + "default") == 0) dir_is_default = true; xmlFree(id); } |