summaryrefslogtreecommitdiff
path: root/usr.bin/ftp/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/ftp/main.c')
-rw-r--r--usr.bin/ftp/main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index e0c8b51925e..df9eb3c5732 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.5 1996/06/26 05:33:38 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.6 1996/09/03 18:00:06 deraadt Exp $ */
/*
* Copyright (c) 1985, 1989, 1993, 1994
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.5 1996/06/26 05:33:38 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.6 1996/09/03 18:00:06 deraadt Exp $";
#endif
#endif /* not lint */
@@ -52,7 +52,9 @@ static char rcsid[] = "$OpenBSD: main.c,v 1.5 1996/06/26 05:33:38 deraadt Exp $"
*/
/*#include <sys/ioctl.h>*/
#include <sys/types.h>
+#include <sys/file.h>
#include <sys/socket.h>
+#include <netinet/in.h>
#include <arpa/ftp.h>
@@ -168,7 +170,10 @@ main(argc, argv)
ret = 1;
goto bail;
}
-
+ if (!strncmp(host, "http://", strlen("http://"))) {
+ http_fetch(host);
+ goto bail;
+ }
if (strncmp(host, "ftp://", sizeof("ftp://")-1) == 0) {
host += sizeof("ftp://") - 1;
p = strchr(host, '/');
@@ -218,8 +223,10 @@ main(argc, argv)
/* get ready for the next file */
bail:
- if (bufp)
+ if (bufp) {
free(bufp);
+ bufp = NULL;
+ }
if (connected)
disconnect(1, xargv);
--argc;