curl-users
Re: Why doesn't set CURLFTP_CREATE_DIR_RETRY when run “curl --ftp-create-dirs”
Date: Fri, 22 Apr 2016 00:34:02 -0400
On 2016-04-21 23:52, Leif W wrote:
> Anyways, attached is an UNTESTED patch (diff -u), for discussion. It
Naturally, despite considering the patch for quite a long time, after I
send it, I immediately spot a problem that seems completely obvious. :)
+ } else if(curlx_strequal(nextarg, "-")) {
This assumes there will always be a nextarg, but there may well not be.
The result should be the same for both cases, so this should be an ||
and check if nextarg is NULL or starts with "-", both indicate that
there is no [num] option to get.
+ } else if(nextarg == NULL || curlx_strequal(nextarg, "-")) {
Also changed to use str2unum to let that give BAD_NUMERIC or
BAD_NEGATIVE_NUMERIC, included error message and threw BAD_PARAM instead
of BAD_NUMERIC, to try to be more clear about what the problem was, if any.
--Leif
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-users
FAQ: https://curl.haxx.se/docs/faq.html
Etiquette: https://curl.haxx.se/mail/etiquette.html
- text/plain attachment: curl-tool-ftp-create-dirs.patch