make sure that state and city are defined
[spider.git] / perl / Prefix.pm
index 65074b83d0c5f98c01f75e877dcfd6fee9032b4f..48206cea6b4cce0a861b4dcc775b3e5789bdefa8 100644 (file)
@@ -473,14 +473,17 @@ sub to_ciz
        return @out;
 }
 
-# get the full country data (dxcc, itu, cq, state) as a list
+# get the full country data (dxcc, itu, cq, state, city) as a list
 # from a callsign. 
 sub cty_data
 {
        my $call = shift;
        
        my @dxcc = extract($call);
-       return @dxcc ? ($dxcc[1]->dxcc, $dxcc[1]->itu, $dxcc[1]->cq, $dxcc[1]->state) : ();
+       if (@dxcc) {
+               return ($dxcc[1]->dxcc, $dxcc[1]->itu, $dxcc[1]->cq, ($dxcc[1]->state||''), ($dxcc[1]->city||''));
+       }
+       return (666,0,0,'','');         
 }
 
 my %valid = (