From 07d4f5c57bdefaa2dd7c7813bf9ed5821dfe22bc Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 7 Jan 2006 02:33:36 +0000 Subject: [project @ 2006-01-07 02:33:36 by jmb] Fix 1347726. svn path=/import/netsurf/; revision=2011 --- content/fetch.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'content/fetch.c') 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) -- cgit v1.2.3