From: Daniel Stenberg Date: Mon, 14 Dec 2020 13:10:33 +0000 (+0100) Subject: tool_setopt: provide helper output in debug builds X-Git-Tag: curl-7_75_0~216 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd7bc174cef5a87bd3f3331f6817b670590522c9;p=thirdparty%2Fcurl.git tool_setopt: provide helper output in debug builds ... for when setopt() returns error. --- diff --git a/src/tool_setopt.c b/src/tool_setopt.c index b9c3054703..196affc042 100644 --- a/src/tool_setopt.c +++ b/src/tool_setopt.c @@ -31,6 +31,7 @@ #include "tool_easysrc.h" #include "tool_setopt.h" #include "tool_convert.h" +#include "tool_msgs.h" #include "memdebug.h" /* keep this as LAST include */ @@ -315,7 +316,11 @@ CURLcode tool_setopt_enum(CURL *curl, struct GlobalConfig *config, } } - nomem: +#ifdef DEBUGBUILD + if(ret) + warnf(config, "option %s returned error (%d)\n", name, (int)ret); +#endif + nomem: return ret; }