diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2001-10-06 22:20:25 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2001-10-06 22:20:25 -0400 |
commit | f78e27712a4f44dbdf3c1532c3d1958989bf40a5 (patch) | |
tree | 51a8f8acd39f65da307ae05a0b9276490e03bedd /src/LYGetFile.c | |
parent | fc99820d832c512631aa418520f5bc6a204e8b91 (diff) | |
download | lynx-snapshots-f78e27712a4f44dbdf3c1532c3d1958989bf40a5.tar.gz |
snapshot of project "lynx", label v2-8-5dev_3
Diffstat (limited to 'src/LYGetFile.c')
-rw-r--r-- | src/LYGetFile.c | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/src/LYGetFile.c b/src/LYGetFile.c index 3ea3e2b9..1c4097ea 100644 --- a/src/LYGetFile.c +++ b/src/LYGetFile.c @@ -716,7 +716,9 @@ Try_Redirected_URL: } { - if (url_type == FTP_URL_TYPE && !ftp_ok) { + if (!ftp_ok + && (url_type == FTP_URL_TYPE + || url_type == NCFTP_URL_TYPE)) { HTUserMsg(FTP_DISABLED); return(NULLFILE); } @@ -752,6 +754,7 @@ Try_Redirected_URL: if (url_type == HTTP_URL_TYPE || url_type == HTTPS_URL_TYPE || url_type == FTP_URL_TYPE || + url_type == NCFTP_URL_TYPE || url_type == CSO_URL_TYPE) fix_httplike_urls(doc, url_type); WWWDoc.address = doc->address; /* possible reload */ @@ -899,7 +902,8 @@ Try_Redirected_URL: (no_goto_finger && url_type == FINGER_URL_TYPE) || (no_goto_ftp && - url_type == FTP_URL_TYPE) || + (url_type == FTP_URL_TYPE || + url_type == NCFTP_URL_TYPE)) || (no_goto_gopher && url_type == GOPHER_URL_TYPE) || (no_goto_http && @@ -1552,6 +1556,20 @@ PRIVATE int fix_httplike_urls ARGS2( LYTrimHtmlSep(doc->address); CTRACE((tfp, " changed to '%s'\n", doc->address)); CTRACE_SLEEP(MessageSecs); + } else if (type == NCFTP_URL_TYPE) { + char *path = NULL; + char *first = doc->address; + char *second = strchr(first, ':'); + + CTRACE((tfp, "fix_httplike_urls: URL '%s'\n", doc->address)); + + *second++ = '\0'; + HTSprintf0(&path, "ftp://%s%s", first, second); + FREE(doc->address); + doc->address = path; + + CTRACE((tfp, " changed to '%s'\n", doc->address)); + CTRACE_SLEEP(MessageSecs); } #endif /* DISABLE_FTP */ @@ -1565,12 +1583,12 @@ PRIVATE int fix_httplike_urls ARGS2( if (type == HTTP_URL_TYPE || type == HTTPS_URL_TYPE) { if ((slash-2) - strchr(doc->address, ':')) { - /* - * Turns out we were not looking at the right slash after all, - * there must have been more than one "://" which is valid - * at least for http URLs (later occurrences can be part of - * a query string, for example), so leave this alone, too. - kw - */ + /* + * Turns out we were not looking at the right slash after all, + * there must have been more than one "://" which is valid + * at least for http URLs (later occurrences can be part of + * a query string, for example), so leave this alone, too. - kw + */ return(0); } if (strchr(doc->address, '?')) { |