summaryrefslogtreecommitdiff
path: root/content/fetchers
diff options
context:
space:
mode:
Diffstat (limited to 'content/fetchers')
-rw-r--r--content/fetchers/fetch_curl.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/content/fetchers/fetch_curl.c b/content/fetchers/fetch_curl.c
index e11829b46..ca2d86845 100644
--- a/content/fetchers/fetch_curl.c
+++ b/content/fetchers/fetch_curl.c
@@ -1219,36 +1219,9 @@ fetch_curl_post_convert(struct form_successful_control *control)
for (; control; control = control->next) {
if (control->file) {
char *leafname = 0;
-#ifdef riscos
- char *temp;
- int leaflen;
-
- temp = strrchr(control->value, '.');
- if (!temp)
- temp = control->value; /* already leafname */
- else
- temp += 1;
-
- leaflen = strlen(temp);
-
- leafname = malloc(leaflen + 1);
- if (!leafname) {
- LOG(("malloc failed"));
- continue;
- }
- memcpy(leafname, temp, leaflen + 1);
-
- /* and s/\//\./g */
- for (temp = leafname; *temp; temp++)
- if (*temp == '/')
- *temp = '.';
-#else
- leafname = strrchr(control->value, '/') ;
- if (!leafname)
- leafname = control->value;
- else
- leafname += 1;
-#endif
+
+ leafname = filename_from_path(control->value);
+
/* We have to special case filenames of "", so curl
* a) actually attempts the fetch and
* b) doesn't attempt to open the file ""
@@ -1288,9 +1261,7 @@ fetch_curl_post_convert(struct form_successful_control *control)
control->value));
free(mimetype);
}
-#ifdef riscos
free(leafname);
-#endif
}
else {
code = curl_formadd(&post, &last,