From d24a2ffefe37501e65b57719ca8a8aaa0035a57d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Oct 2022 10:55:05 +0200 Subject: 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 --- src/tool_operate.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/tool_operate.c') 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 -- cgit v1.2.1