wget: fix compile warnings when WGET_FTP is not selected

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2024-09-26 16:27:10 +02:00
parent 371fe9f71d
commit a667a7f020
2 changed files with 7 additions and 4 deletions

View file

@ -1178,7 +1178,9 @@ static void download_one_url(const char *url)
/*G.content_len = 0; - redundant, got_clen = 0 is enough */ /*G.content_len = 0; - redundant, got_clen = 0 is enough */
G.got_clen = 0; G.got_clen = 0;
G.chunked = 0; G.chunked = 0;
if (use_proxy || target.protocol[0] != 'f' /*not ftp[s]*/) { if (!ENABLE_FEATURE_WGET_FTP
|| use_proxy || target.protocol[0] != 'f' /*not ftp[s]*/
) {
/* /*
* HTTP session * HTTP session
*/ */
@ -1447,14 +1449,15 @@ However, in real world it was observed that some web servers
/* For HTTP, data is pumped over the same connection */ /* For HTTP, data is pumped over the same connection */
dfp = sfp; dfp = sfp;
} else { }
#if ENABLE_FEATURE_WGET_FTP #if ENABLE_FEATURE_WGET_FTP
else {
/* /*
* FTP session * FTP session
*/ */
sfp = prepare_ftp_session(&dfp, &target, lsa); sfp = prepare_ftp_session(&dfp, &target, lsa);
#endif
} }
#endif
free(lsa); free(lsa);

View file

@ -366,7 +366,7 @@ static void set_rtc_param(const char **pp_rtcname, char *rtc_param)
/* handle param name */ /* handle param name */
eq = strchr(rtc_param, '='); eq = strchr(rtc_param, '=');
if (!eq) if (!eq)
bb_error_msg_and_die("expected <param>=<value>"); bb_simple_error_msg_and_die("expected <param>=<value>");
*eq = '\0'; *eq = '\0';
param.param = resolve_rtc_param_alias(rtc_param); param.param = resolve_rtc_param_alias(rtc_param);
*eq = '='; *eq = '=';