diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2004-04-07 19:19:31 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2004-04-07 19:19:31 +0000 |
commit | 29578a4fd851328186e4c394f61a18abcc00f681 (patch) | |
tree | eb9c4f4d9b465761467ece4054f9e996eca1a92a /content | |
parent | 64cd951ae260e5418145233005c45462d66a7575 (diff) | |
download | netsurf-29578a4fd851328186e4c394f61a18abcc00f681.tar.gz netsurf-29578a4fd851328186e4c394f61a18abcc00f681.tar.bz2 |
[project @ 2004-04-07 19:19:31 by jmb]
Take account of file path when creating POST data.
svn path=/import/netsurf/; revision=738
Diffstat (limited to 'content')
-rw-r--r-- | content/fetch.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/content/fetch.c b/content/fetch.c index 78fd53812..d5bd31733 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -735,9 +735,9 @@ struct curl_httppost *fetch_post_convert(struct form_successful_control *control temp = control->value; /* already leafname */ else temp += 1; - leafname = malloc(strlen(temp)); + leafname = calloc(strlen(temp)+5, sizeof(char)); if (!leafname) { - LOG(("malloc failed")); + LOG(("calloc failed")); free(mimetype); continue; } @@ -751,7 +751,8 @@ struct curl_httppost *fetch_post_convert(struct form_successful_control *control #endif curl_formadd(&post, &last, CURLFORM_COPYNAME, control->name, - CURLFORM_FILE, leafname, + CURLFORM_FILE, control->value, + CURLFORM_FILENAME, leafname, CURLFORM_CONTENTTYPE, (mimetype != 0 ? mimetype : "text/plain"), CURLFORM_END); @@ -798,6 +799,7 @@ bool fetch_can_fetch(const char *url) if (strlen(data->protocols[i]) == len && strncasecmp(url, data->protocols[i], len) == 0) return true; + return false; } |