diff options
author | adam <adam@FreeBSD.org> | 1996-10-24 00:15:44 +0000 |
---|---|---|
committer | adam <adam@FreeBSD.org> | 1996-10-24 00:15:44 +0000 |
commit | f3ebc6792c7dce28a9498053469f14e0b01dce4e (patch) | |
tree | f59a39857e61cff0ca67635b961f45dabd6834dd /usr.bin | |
parent | c7268b18135e4c0c2496469a2647ca3b81ebafb9 (diff) | |
download | FreeBSD-src-f3ebc6792c7dce28a9498053469f14e0b01dce4e.zip FreeBSD-src-f3ebc6792c7dce28a9498053469f14e0b01dce4e.tar.gz |
old host:/filename syntax was broken
implement /filename syntax for completeness
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/fetch/main.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/fetch/main.c b/usr.bin/fetch/main.c index 8f18324..62a84fe 100644 --- a/usr.bin/fetch/main.c +++ b/usr.bin/fetch/main.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. */ -/* $Id: main.c,v 1.23 1996/09/19 18:07:20 peter Exp $ */ +/* $Id: main.c,v 1.24 1996/10/06 00:44:24 jmz Exp $ */ #include <sys/types.h> #include <sys/socket.h> @@ -472,7 +472,6 @@ parse (char *s) warnx("no filename??"); usage(); } - ftp = 1; } else if (strncasecmp (s, "http://", 7) == 0) { /* http://host.name/file/name */ @@ -495,13 +494,17 @@ parse (char *s) return; } else { - /* assume /host.name:/file/name */ + /* assume host.name:/file/name */ p = strchr (s, ':'); if (!p) { - warnx ("no filename??"); - usage (); + /* assume /file/name */ + host = NULL; + ftp = http = 0; + file_to_get = s; + return; } } + ftp = 1; *p++ = 0; host = s; s = strrchr (p, '/'); |