X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FRoute.pm;h=6c22e22fc19d805eeb4b4516f59dea1f731c6df0;hb=a931b090e0be3329bcbf7deddb7c17c30fa0e74a;hp=695eed8dffa05aea3e627b4a31c793060d6000f0;hpb=a1fe338de72800232a8623f592c1a62d1f994fad;p=spider.git diff --git a/perl/Route.pm b/perl/Route.pm index 695eed8d..6c22e22f 100644 --- a/perl/Route.pm +++ b/perl/Route.pm @@ -170,20 +170,6 @@ sub conf return $r ? 1 : 0; } -# -# pc59 entity encoding and decoding -# -sub enc_pc59 -{ - my $self = shift; - my $sort = shift || 'N'; - my $out = "$sort$self->{flag}$self->{call}"; - if ($self->{build}) { - $out .= "b$self->{build}"; - } elsif ($self->{version}) { - $out .= "v$self->{version}"; - } -} sub dec_pc59 { @@ -191,16 +177,17 @@ sub dec_pc59 my $s = ref($node) ? shift : $node; $node = undef; - my ($sort, $here, $call) = unpack "A A A*", $s; + my ($sort, $here, $callstring) = unpack "A A A*", $s; + my ($call) = $callstring =~ /^([A-Z0-9\-]+)/; return unless is_callsign($call); return unless $here =~ /^[0123]$/; return unless $sort =~ /^[NUE]$/; if ($sort eq 'E' || $sort eq 'N') { $node = Route::Node::get($call) || Route::Node->new($call); - if ($s =~ /b([\d\.])/) { + if ($callstring =~ /b([\d\.])/) { $node->{build} = $1; } - if ($s =~ /v([\d\.])/) { + if ($callstring =~ /v([\d\.])/) { $node->{version} = $1; } } elsif ($sort eq 'U') {