danf: curl-www ipwhere.pm,1.4,1.5

[email protected]
Newsgroups gmane.comp.web.curl.www.cvs
Message-ID <[email protected]>
Update of /cvsroot/curl/curl-www
In directory labb:/tmp/cvs-serv9980

Modified Files:
	ipwhere.pm 
Log Message:
Pin the country match to the beginning of the string to reduce the chance
of a false partial match.


Index: ipwhere.pm
===================================================================
RCS file: /cvsroot/curl/curl-www/ipwhere.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ipwhere.pm	23 Jul 2007 20:13:07 -0000	1.4
+++ ipwhere.pm	7 Aug 2007 18:37:58 -0000	1.5
@@ -525,12 +525,12 @@
 sub country2tld {
     my ($cntr)=@_;
 
-    if ($cntr =~ /Great Britain/) {
+    if ($cntr =~ /^Great Britain/) {
     	return "uk";	# TLD is uk, not gb
     }
 
     for (keys(%tld2cntr)) {
-        if ($cntr =~ /$tld2cntr{$_}/) {
+        if ($cntr =~ /^$tld2cntr{$_}/) {
         	return $_;
         }
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.