summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2006-01-07 02:33:36 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2006-01-07 02:33:36 +0000
commit07d4f5c57bdefaa2dd7c7813bf9ed5821dfe22bc (patch)
tree09980896d2ad9798bccdf02f6d46a53aead6ab26
parent04f3f5f23169abca93374adab256d0e62b60d7a9 (diff)
downloadnetsurf-07d4f5c57bdefaa2dd7c7813bf9ed5821dfe22bc.tar.gz
netsurf-07d4f5c57bdefaa2dd7c7813bf9ed5821dfe22bc.tar.bz2
[project @ 2006-01-07 02:33:36 by jmb]
Fix 1347726. svn path=/import/netsurf/; revision=2011
-rw-r--r--content/fetch.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/content/fetch.c b/content/fetch.c
index c83e6e9f8..e5878cf0d 100644
--- a/content/fetch.c
+++ b/content/fetch.c
@@ -858,6 +858,7 @@ struct curl_httppost *fetch_post_convert(struct form_successful_control *control
struct curl_httppost *post = 0, *last = 0;
char *mimetype = 0;
char *leafname = 0, *temp = 0;
+ int leaflen;
for (; control; control = control->next) {
if (control->file) {
@@ -868,13 +869,21 @@ struct curl_httppost *fetch_post_convert(struct form_successful_control *control
temp = control->value; /* already leafname */
else
temp += 1;
- leafname = calloc(strlen(temp)+5, sizeof(char));
+
+ leaflen = strlen(temp);
+
+ leafname = malloc(leaflen + 1);
if (!leafname) {
- LOG(("calloc failed"));
+ LOG(("malloc failed"));
free(mimetype);
continue;
}
- __unixify_std(temp, leafname, strlen(temp), 0xfff);
+ memcpy(leafname, temp, leaflen + 1);
+
+ /* and s/\//\./g */
+ for (temp = leafname; *temp; temp++)
+ if (*temp == '/')
+ *temp = '.';
#else
leafname = strrchr(control->value, '/') ;
if (!leafname)