fixed isolation for routes finally?
[spider.git] / cmd / clear / spots.pl
index bdce5c86fc89e5604cf2385b098bb73d067325d6..d2a59bc07131195176775adb74fe693d045efe98 100644 (file)
@@ -6,28 +6,29 @@
 # $Id$
 #
 my ($self, $line) = @_;
-my @f = split /\s+/, $line;
+my @f = split(/\s+/, $line);
 my @out;
 my $dxchan = $self;
 my $sort = 'spots';
 my $flag;
 my $fno = 1;
 my $call = $dxchan->call;
+my $f;
 
-my $f = lc shift @f if @f;
 if ($self->priv >= 8) {
-       my $uref = DXUser->get(uc $f);
-       $call = $uref->call if $uref;
-       $f = undef;
-       $f = lc shift @f if @f;
-       if ($f && $f eq 'input') {
+       if (is_callsign(uc $f[0])) {
+               $f = uc shift @f;
+               my $uref = DXUser->get($f);
+               $call = $uref->call if $uref;
+       }
+       if ($f[0] eq 'input') {
+               shift @f;
                $flag = 'in';
-               $f = undef;
-               $f = lc shift @f if @f;
        }
 }
 
-$fno = $f if $f;
+$fno = shift @f if @f && $f[0] =~ /^\d$/;
+
 my $filter = Filter::read_in($sort, $call, $flag);
 Filter::delete($sort, $call, $flag, $fno);
 $flag = $flag ? "input " : "";