diff options
| author | Bill Fenner <fenner@FreeBSD.org> | 1997-10-08 18:43:53 +0000 |
|---|---|---|
| committer | Bill Fenner <fenner@FreeBSD.org> | 1997-10-08 18:43:53 +0000 |
| commit | 21d466b21ac8fafd83e1bf99a28e1a440129bcd0 (patch) | |
| tree | 3dffdc5db09bd0b91cc337d7476315cdc0b29405 /usr.bin | |
| parent | 9e5fbad43e35dffecee798564b4fed5c0097f215 (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/fetch/ftp.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/usr.bin/fetch/ftp.c b/usr.bin/fetch/ftp.c index 097250565d6ff..362d1c9b77d23 100644 --- a/usr.bin/fetch/ftp.c +++ b/usr.bin/fetch/ftp.c @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ftp.c,v 1.7 1997/05/31 14:45:41 ache Exp $ + * $Id: ftp.c,v 1.8 1997/10/06 01:09:56 fenner Exp $ */ #include <sys/types.h> @@ -173,7 +173,17 @@ ftp_parse(struct fetch_state *fs, const char *uri) dp = ftps->ftp_remote_dirs; while ((s = strchr(s, '/')) != 0) { *s++ = '\0'; - *dp++ = percent_decode(r); + /* + * Skip double-slashes. According to RFC1738, + * double-slashes mean "send 'CWD '", which is + * a syntax error to most FTP servers. Instead, + * we just pretend that multiple slashes are a + * single slash. + */ + if (*r == '\0') + ftps->ftp_remote_ndirs--; + else + *dp++ = percent_decode(r); r = s; } } else { |
