summaryrefslogtreecommitdiff
path: root/render/textplain.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-01-25 10:00:33 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2014-01-25 10:00:33 +0000
commit46b8fbaeac4dd1e35945ae1338056156e5b3b86b (patch)
tree8fcb55f1859a6ea4f33c67f6299b916e09e21512 /render/textplain.c
parent96e5368d34d960dd1aa71dcac81079f331adfab6 (diff)
downloadnetsurf-46b8fbaeac4dd1e35945ae1338056156e5b3b86b.tar.gz
netsurf-46b8fbaeac4dd1e35945ae1338056156e5b3b86b.tar.bz2
Use corestring.
Diffstat (limited to 'render/textplain.c')
-rw-r--r--render/textplain.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/render/textplain.c b/render/textplain.c
index 892e03e57..5254e6aba 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -46,6 +46,7 @@
#include "render/textplain.h"
#include "render/html.h"
#include "render/search.h"
+#include "utils/corestrings.h"
#include "utils/http.h"
#include "utils/log.h"
#include "utils/messages.h"
@@ -159,7 +160,6 @@ static const content_handler textplain_content_handler = {
.no_share = true,
};
-static lwc_string *textplain_charset;
static lwc_string *textplain_default_charset;
/**
@@ -170,16 +170,9 @@ nserror textplain_init(void)
lwc_error lerror;
nserror error;
- lerror = lwc_intern_string("charset", SLEN("charset"),
- &textplain_charset);
- if (lerror != lwc_error_ok) {
- return NSERROR_NOMEM;
- }
-
lerror = lwc_intern_string("Windows-1252", SLEN("Windows-1252"),
&textplain_default_charset);
if (lerror != lwc_error_ok) {
- lwc_string_unref(textplain_charset);
return NSERROR_NOMEM;
}
@@ -187,7 +180,6 @@ nserror textplain_init(void)
&textplain_content_handler);
if (error != NSERROR_OK) {
lwc_string_unref(textplain_default_charset);
- lwc_string_unref(textplain_charset);
}
return error;
@@ -202,11 +194,6 @@ void textplain_fini(void)
lwc_string_unref(textplain_default_charset);
textplain_default_charset = NULL;
}
-
- if (textplain_charset != NULL) {
- lwc_string_unref(textplain_charset);
- textplain_charset = NULL;
- }
}
/**
@@ -233,7 +220,7 @@ nserror textplain_create(const content_handler *handler,
return error;
}
- error = http_parameter_list_find_item(params, textplain_charset,
+ error = http_parameter_list_find_item(params, corestring_lwc_charset,
&encoding);
if (error != NSERROR_OK) {
encoding = lwc_string_ref(textplain_default_charset);