From: minima Date: Tue, 18 Dec 2001 11:15:55 +0000 (+0000) Subject: make the check for defined rather than 0 X-Git-Tag: R_1_50~131 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=56c9ecfcd367bd05b9e6a5a6a8fa94e571dda9af;p=spider.git make the check for defined rather than 0 --- diff --git a/cmd/wcy.pl b/cmd/wcy.pl index 17f8d6a3..4d0122b9 100644 --- a/cmd/wcy.pl +++ b/cmd/wcy.pl @@ -38,14 +38,14 @@ my $d = int ($main::systime / 3600) * 3600 + 18 * 60; my %args = map {split /\s*=\s*/} split /\s*,\s*/, lc $line; # check the ranges of each one -push @out, $self->msg('wcy1', 'k') unless $args{k} && $args{k} >= 0 && $args{k} <= 9; -push @out, $self->msg('wcy1', 'espk') unless $args{expk} && $args{expk} >= 0 && $args{expk} <= 9; -push @out, $self->msg('wcy1', 'a') unless $args{a} && $args{a} >= 0 && $args{a} <= 400; -push @out, $self->msg('wcy1', 'r') unless $args{r} && $args{r} >= 0 && $args{r} <= 300; -push @out, $self->msg('wcy1', 'sf') unless $args{sf} && $args{sf} >= 65 && $args{sf} <= 300; -push @out, $self->msg('wcy1', 'sa') unless $args{sa} && grep $args{sa} eq $_, qw(qui eru act maj pro war nil); -push @out, $self->msg('wcy1', 'gmf') unless $args{gmf} && grep $args{gmf} eq $_, qw(qui act min maj sev mag war nil); -push @out, $self->msg('wcy1', 'au') unless $args{au} && grep $args{au} eq $_, qw(no aurora strong); +push @out, $self->msg('wcy1', 'k') unless defined $args{k} && $args{k} >= 0 && $args{k} <= 9; +push @out, $self->msg('wcy1', 'espk') unless defined $args{expk} && $args{expk} >= 0 && $args{expk} <= 9; +push @out, $self->msg('wcy1', 'a') unless defined $args{a} && $args{a} >= 0 && $args{a} <= 400; +push @out, $self->msg('wcy1', 'r') unless defined $args{r} && $args{r} >= 0 && $args{r} <= 300; +push @out, $self->msg('wcy1', 'sf') unless defined $args{sf} && $args{sf} >= 65 && $args{sf} <= 300; +push @out, $self->msg('wcy1', 'sa') unless defined $args{sa} && grep $args{sa} eq $_, qw(qui eru act maj pro war nil); +push @out, $self->msg('wcy1', 'gmf') unless defined $args{gmf} && grep $args{gmf} eq $_, qw(qui act min maj sev mag war nil); +push @out, $self->msg('wcy1', 'au') unless defined $args{au} && grep $args{au} eq $_, qw(no aurora strong); push @out, $self->msg('wcy2') if WCY::dup($d); #$DB::single=1; diff --git a/cmd/wwv.pl b/cmd/wwv.pl index 9f4350a6..3b0397fc 100644 --- a/cmd/wwv.pl +++ b/cmd/wwv.pl @@ -44,9 +44,9 @@ $forecast = unpad($forecast); my %args = map {split /\s*=\s*/, lc $_} @l; # check the ranges of each one -push @out, $self->msg('wwv1', 'k') unless $args{k} && $args{k} >= 0 && $args{k} <= 9; -push @out, $self->msg('wwv1', 'a') unless $args{a} && $args{a} >= 0 && $args{a} <= 400; -push @out, $self->msg('wwv1', 'sf') unless $args{sf} && $args{sf} >= 65 && $args{sf} <= 300; +push @out, $self->msg('wwv1', 'k') unless defined $args{k} && $args{k} >= 0 && $args{k} <= 9; +push @out, $self->msg('wwv1', 'a') unless defined $args{a} && $args{a} >= 0 && $args{a} <= 400; +push @out, $self->msg('wwv1', 'sf') unless defined $args{sf} && $args{sf} >= 65 && $args{sf} <= 300; push @out, $self->msg('wwv1', 'forecast') unless $forecast; push @out, $self->msg('wwv2') if Geomag::dup($d, $args{sf}, $args{k}, $args{a}, $forecast);