1 From 1cb3af1e5b392ac2fae6d9ed8b5d7be399d9f37e Mon Sep 17 00:00:00 2001
2 From: Ygal Blum <address@hidden>
3 Date: Tue, 24 Nov 2015 11:24:54 +0200
4 Subject: [PATCH] Fix compilation when without-ssl is selected
8 src/main.c | 12 ++++++++++--
10 src/retr.c | 18 +++++++++++++++---
12 5 files changed, 37 insertions(+), 7 deletions(-)
14 diff --git a/src/ftp.c b/src/ftp.c
15 index 80420ef..5394b71 100644
18 @@ -393,7 +393,9 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
19 if (!(cmd & DO_LOGIN))
23 using_data_security = con->st & DATA_CHANNEL_SECURITY;
26 else /* cmd & DO_LOGIN */
28 diff --git a/src/main.c b/src/main.c
29 index 61a157a..4641008 100644
32 @@ -1842,13 +1842,21 @@ only if outputting to a regular file.\n"));
35 if ((opt.recursive || opt.page_requisites)
36 - && ((url_scheme (*t) != SCHEME_FTP && url_scheme (*t) != SCHEME_FTPS)
37 + && ((url_scheme (*t) != SCHEME_FTP
39 + && url_scheme (*t) != SCHEME_FTPS
42 || url_uses_proxy (url_parsed)))
44 int old_follow_ftp = opt.follow_ftp;
46 /* Turn opt.follow_ftp on in case of recursive FTP retrieval */
47 - if (url_scheme (*t) == SCHEME_FTP || url_scheme (*t) == SCHEME_FTPS)
48 + if (url_scheme (*t) == SCHEME_FTP
50 + || url_scheme (*t) == SCHEME_FTPS
55 retrieve_tree (url_parsed, NULL);
56 diff --git a/src/recur.c b/src/recur.c
57 index 25cdbb7..b212ec6 100644
60 @@ -610,7 +610,11 @@ download_child (const struct urlpos *upos, struct url *parent, int depth,
61 u_scheme_like_http = schemes_are_similar_p (u->scheme, SCHEME_HTTP);
63 /* 1. Schemes other than HTTP are normally not recursed into. */
64 - if (!u_scheme_like_http && !((u->scheme == SCHEME_FTP || u->scheme == SCHEME_FTPS) && opt.follow_ftp))
65 + if (!u_scheme_like_http && !((u->scheme == SCHEME_FTP
67 + || u->scheme == SCHEME_FTPS
69 + ) && opt.follow_ftp))
71 DEBUGP (("Not following non-HTTP schemes.\n"));
72 reason = WG_RR_NONHTTP;
73 diff --git a/src/retr.c b/src/retr.c
74 index 318b09c..a6a9bd7 100644
77 @@ -837,7 +837,11 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file,
78 FTP. In these cases we must decide whether the text is HTML
79 according to the suffix. The HTML suffixes are `.html',
80 `.htm' and a few others, case-insensitive. */
81 - if (redirection_count && local_file && (u->scheme == SCHEME_FTP || u->scheme == SCHEME_FTPS))
82 + if (redirection_count && local_file && (u->scheme == SCHEME_FTP
84 + || u->scheme == SCHEME_FTPS
88 if (has_html_suffix_p (local_file))
90 @@ -1099,12 +1103,20 @@ retrieve_from_file (const char *file, bool html, int *count)
92 proxy = getproxy (cur_url->url);
93 if ((opt.recursive || opt.page_requisites)
94 - && ((cur_url->url->scheme != SCHEME_FTP && cur_url->url->scheme != SCHEME_FTPS) || proxy))
95 + && ((cur_url->url->scheme != SCHEME_FTP
97 + && cur_url->url->scheme != SCHEME_FTPS
101 int old_follow_ftp = opt.follow_ftp;
103 /* Turn opt.follow_ftp on in case of recursive FTP retrieval */
104 - if (cur_url->url->scheme == SCHEME_FTP || cur_url->url->scheme == SCHEME_FTPS)
105 + if (cur_url->url->scheme == SCHEME_FTP
107 + || cur_url->url->scheme == SCHEME_FTPS
112 status = retrieve_tree (parsed_url ? parsed_url : cur_url->url,
113 diff --git a/src/url.c b/src/url.c
114 index 56079cd..c62867f 100644
117 @@ -1787,7 +1787,11 @@ path_simplify (enum url_scheme scheme, char *path)
118 for (--t; t > beg && t[-1] != '/'; t--)
121 - else if (scheme == SCHEME_FTP || scheme == SCHEME_FTPS)
122 + else if (scheme == SCHEME_FTP
124 + || scheme == SCHEME_FTPS
128 /* If we're at the beginning, copy the "../" literally
129 and move the beginning so a later ".." doesn't remove