From: Dirk Koopman Date: Fri, 20 Jul 2007 14:41:53 +0000 (+0100) Subject: prevent hop counts of -1 being generated. X-Git-Tag: 1.55~92 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=216faa551997c3eaf1a7ccb9d512efb8d50df118;p=spider.git prevent hop counts of -1 being generated. --- diff --git a/perl/DXProt.pm b/perl/DXProt.pm index bc753c3d..596f1f08 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -1008,7 +1008,7 @@ sub adjust_hops my $call = $self->{call}; my $hops; - if (($hops) = $s =~ /\^H(\d+)\^?~?$/o) { + if (($hops) = $s =~ /\^H([-\d]+)\^?~?$/o) { my ($pcno) = $s =~ /^PC(\d\d)/o; confess "$call called adjust_hops with '$s'" unless $pcno; my $ref = $nodehops{$call} if %nodehops; @@ -1017,8 +1017,11 @@ sub adjust_hops return "" if defined $newhops && $newhops == 0; $newhops = $ref->{default} unless $newhops; return "" if defined $newhops && $newhops == 0; - $newhops = $hops if !$newhops; - $s =~ s/\^H(\d+)(\^~?)$/\^H$newhops$2/ if $newhops; + $newhops = $hops unless $newhops; + return "" unless $newhops > 0; + $s =~ s/\^H(\d+)(\^~?)$/\^H$newhops$2/ if $newhops != $hops; + } else { + return "" unless $hops > 0; } } return $s; diff --git a/perl/Version.pm b/perl/Version.pm index 5b13b540..db524ea5 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.54'; $subversion = '0'; -$build = '122'; +$build = '123'; 1;