summaryrefslogtreecommitdiff
path: root/src/tool_operate.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-10-10 10:55:05 +0200
committerDaniel Stenberg <daniel@haxx.se>2022-10-10 22:39:41 +0200
commitd24a2ffefe37501e65b57719ca8a8aaa0035a57d (patch)
treeacb41d1f22c481ca882d1920e41df3846d0747a4 /src/tool_operate.c
parentb82eb72d8097c93313329a4aecd41317a293f506 (diff)
downloadcurl-d24a2ffefe37501e65b57719ca8a8aaa0035a57d.tar.gz
curl/add_file_name_to_url: use the libcurl URL parser
instead of the custom error-prone parser, to extract and update the path of the given URL Closes #9683
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r--src/tool_operate.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index d45c3315e..544c04a29 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1131,12 +1131,10 @@ static CURLcode single_transfer(struct GlobalConfig *global,
/*
* We have specified a file to upload and it isn't "-".
*/
- char *nurl = add_file_name_to_url(per->this_url, per->uploadfile);
- if(!nurl) {
- result = CURLE_OUT_OF_MEMORY;
+ result = add_file_name_to_url(per->curl, &per->this_url,
+ per->uploadfile);
+ if(result)
break;
- }
- per->this_url = nurl;
}
else if(per->uploadfile && stdin_upload(per->uploadfile)) {
/* count to see if there are more than one auth bit set