From 7f2d86b2f6eeb51948978a914ad6062481b7db39 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 21 Mar 2004 23:36:05 +0000 Subject: [project @ 2004-03-21 23:36:05 by jmb] Make the filename unixified and leafnamelike svn path=/import/netsurf/; revision=648 --- content/fetch.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'content') diff --git a/content/fetch.c b/content/fetch.c index 8ab31c92c..d65186284 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -25,6 +25,9 @@ #include #include #include +#ifdef riscos +#include +#endif #include "curl/curl.h" #include "netsurf/utils/config.h" #include "netsurf/content/fetch.h" @@ -677,16 +680,27 @@ struct HttpPost *fetch_post_convert(struct form_successful_control *control) { struct HttpPost *post = 0, *last = 0; char *mimetype = 0; + char *leafname = 0, *temp = 0; for (; control; control = control->next) { if (control->file) { mimetype = fetch_mimetype(control->value); +#ifdef riscos + temp = strrchr(control->value, '.') + 1; + leafname = xcalloc(strlen(temp), sizeof(char)); + __unixify_std(temp, leafname, strlen(temp), 0xfff); +#else + leafname = strrchr(control->value, '/') + 1; +#endif curl_formadd(&post, &last, CURLFORM_COPYNAME, control->name, - CURLFORM_FILE, control->value, + CURLFORM_FILE, leafname, CURLFORM_CONTENTTYPE, (mimetype != 0 ? mimetype : "text/plain"), CURLFORM_END); +#ifdef riscos + xfree(leafname); +#endif xfree(mimetype); } else { -- cgit v1.2.3