From: Dirk Koopman Date: Tue, 7 Mar 2023 11:50:12 +0000 (+0000) Subject: fix stupid unpad typo in dx command X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=56b93915d65c299a5f2d2e555ee361c056773843;p=spider.git fix stupid unpad typo in dx command --- diff --git a/Changes b/Changes index 43343693..fdfdb9a6 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +07Mar23======================================================================= +1. Fix odd (and old) regression dx command (line ending 59+++) '++' being the + culprit. 06Mar23======================================================================= 1. Fix filter error reporting, including incrementing concurrent error count if there are actually any detected parse errors. diff --git a/cmd/dx.pl b/cmd/dx.pl index d1e27883..a6475347 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -76,7 +76,7 @@ if (is_freq($f[1]) && $f[0] =~ m{^[\w\d]+(?:/[\w\d]+){0,2}$}) { } $line =~ s/^\s*$f[0]//; $line =~ s/^\s*$f[1]//; -$line =~ unpad($line); +$line = unpad($line); $line =~ s/\t+/ /g; # do this here because it needs to be stopped ASAP! $line ||= ' '; diff --git a/perl/DXCIDR.pm b/perl/DXCIDR.pm index b702d7b8..0a829bf1 100644 --- a/perl/DXCIDR.pm +++ b/perl/DXCIDR.pm @@ -162,9 +162,10 @@ sub _sort my @in; my @out; for (@_) { - push @in, [inet_pton(m|:|?AF_INET6:AF_INET, $_), split m|/|]; + my @ip = split m|/|; + push @in, [inet_pton(m|:|?AF_INET6:AF_INET, $ip[0]), @ip]; } - @out = sort {$a->[0] <=> $b->[0]} @in; + @out = sort {$a->[1] cmp $b->[1]} @in; return map { "$_->[1]/$_->[2]"} @out; } diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index d0f9bb65..d1feb3e1 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -602,7 +602,7 @@ sub run_cmd $self->send($self->msg('e26')); $self->disconnect; return (); - } + } } return map {s/([^\s])\s+$/$1/; $_} @ans; } @@ -882,7 +882,6 @@ sub find_cmd_name { if (isdbg('eval')) { my @list = split /\n/, $eval; - my $line; for (@list) { dbg($_ . "\n") if isdbg('eval'); } diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index 207d2771..b89d88ea 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -380,8 +380,8 @@ sub filecopy sub unpad { my $s = shift; - $s =~ s/\s+$//; - $s =~ s/^\s+//; + $s =~ s/^\s*//; + $s =~ s/\s*$//; return $s; }