diff options
author | Daniel Stenberg <daniel@haxx.se> | 2022-10-10 10:55:05 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-10-10 22:39:41 +0200 |
commit | d24a2ffefe37501e65b57719ca8a8aaa0035a57d (patch) | |
tree | acb41d1f22c481ca882d1920e41df3846d0747a4 /src/tool_operate.c | |
parent | b82eb72d8097c93313329a4aecd41317a293f506 (diff) | |
download | curl-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.c | 8 |
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 |