summaryrefslogtreecommitdiff
path: root/content/fetch.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-03-21 23:36:05 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-03-21 23:36:05 +0000
commit7f2d86b2f6eeb51948978a914ad6062481b7db39 (patch)
tree77663b4725ff5f0f07250adec9de5ce90e1b9ee7 /content/fetch.c
parentdc642bc3fa1895e01aa970cdd45f1610e4ad6de9 (diff)
downloadnetsurf-7f2d86b2f6eeb51948978a914ad6062481b7db39.tar.gz
netsurf-7f2d86b2f6eeb51948978a914ad6062481b7db39.tar.bz2
[project @ 2004-03-21 23:36:05 by jmb]
Make the filename unixified and leafnamelike svn path=/import/netsurf/; revision=648
Diffstat (limited to 'content/fetch.c')
-rw-r--r--content/fetch.c16
1 files changed, 15 insertions, 1 deletions
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 <string.h>
#include <strings.h>
#include <time.h>
+#ifdef riscos
+#include <unixlib/local.h>
+#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 {