diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-01-25 09:53:54 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-01-25 09:53:54 +0000 |
commit | 96e5368d34d960dd1aa71dcac81079f331adfab6 (patch) | |
tree | e7819fd60386df3ebb15a9b3ee6c335d4fbdb11f /desktop/download.c | |
parent | ae6874d3088a46a3d02c64ec7e466baaf03a991f (diff) | |
download | netsurf-96e5368d34d960dd1aa71dcac81079f331adfab6.tar.gz netsurf-96e5368d34d960dd1aa71dcac81079f331adfab6.tar.bz2 |
Use corestring.
Diffstat (limited to 'desktop/download.c')
-rw-r--r-- | desktop/download.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/desktop/download.c b/desktop/download.c index 14390c78a..b5427b405 100644 --- a/desktop/download.c +++ b/desktop/download.c @@ -28,6 +28,7 @@ #include "desktop/download.h" #include "desktop/gui.h" #include "desktop/gui_factory.h" +#include "utils/corestrings.h" #include "utils/http.h" #include "utils/url.h" #include "utils/utils.h" @@ -114,26 +115,18 @@ static nserror download_context_process_headers(download_context *ctx) http_header = llcache_handle_get_header(ctx->llcache, "Content-Disposition"); if (http_header != NULL) { - lwc_string *filename; lwc_string *filename_value; http_content_disposition *disposition; - if (lwc_intern_string("filename", SLEN("filename"), - &filename) != lwc_error_ok) { - http_content_type_destroy(content_type); - return NSERROR_NOMEM; - } - error = http_parse_content_disposition(http_header, &disposition); if (error != NSERROR_OK) { - lwc_string_unref(filename); http_content_type_destroy(content_type); return error; } error = http_parameter_list_find_item(disposition->parameters, - filename, &filename_value); + corestring_lwc_filename, &filename_value); if (error == NSERROR_OK) { ctx->filename = download_parse_filename( lwc_string_data(filename_value)); @@ -141,7 +134,6 @@ static nserror download_context_process_headers(download_context *ctx) } http_content_disposition_destroy(disposition); - lwc_string_unref(filename); } ctx->mime_type = lwc_string_ref(content_type->media_type); |