Fixed parsing of the optional ":\d+" port specifier
authorshort <>
Tue, 18 Jun 2002 11:28:14 +0000 (11:28 +0000)
committershort <>
Tue, 18 Jun 2002 11:28:14 +0000 (11:28 +0000)
bin/httpgetdumb

index 9aafa31..6ea04e0 100755 (executable)
@@ -14,7 +14,7 @@ use constant BUFFER_LENGTH=>0x1000;
 
 my %opts;
 getopts "hH",\%opts or die "getopts()";
-@ARGV==1 && $ARGV[0]=~m#^http://([^/]+)(:\d+)?(/.*)$#
+@ARGV==1 && $ARGV[0]=~m#^http://([^/:]+)(?::(\d+))?(/.*)$#
                or die "Syntax: $0 [-hH] http://hostname/pathname";
 my($host,$port,$path)=($1,$2,$3);
 defined $port or $port=DEFAULT_PORT;