improve is_callsign, is_ipaddr
authorDirk Koopman <djk@tobit.co.uk>
Sat, 21 Sep 2019 11:58:26 +0000 (12:58 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Sat, 21 Sep 2019 11:58:26 +0000 (12:58 +0100)
fix typo in update_sysop.pl and watchdbg

perl/DXUtil.pm
perl/update_sysop.pl
perl/watchdbg

index bad92927dff99fea8340977746ddd0c8c92792f4..b9afba12d29dba40bfea78cde38b570642551d70 100644 (file)
@@ -382,11 +382,11 @@ sub unpad
 sub is_callsign
 {
        return $_[0] =~ m!^
-                                         (?:(?:[A-Z]{1,2}\d* | \d[A-Z]{1,2}\d*)/)?   # out of area prefix /
-                                         (?:[A-Z]{1,2}\d+ | \d[A-Z]{1,2}\d+)?        # main prefix one 
-                                         [A-Z]{1,5}                                  # callsign letters
-                                         (?:-(?:\d{1,2}|\#))?                        # - nn possibly (eg G8BPQ-8) or -# (an RBN spot) 
-                                         (?:/[0-9A-Z]{1,7})?                         # / another prefix, callsign or special label (including /MM, /P as well as /EURO or /LGT) possibly
+                                         (?:\d?[A-Z]{1,2}\d*/)?    # out of area prefix /  
+                                         (?:\d?[A-Z]{1,2}\d+)      # main prefix one (required) 
+                                         [A-Z]{1,5}                # callsign letters (required)
+                                         (?:-(?:\d{1,2}|\#))?      # - nn possibly (eg G8BPQ-8) or -# (an RBN spot) 
+                                         (?:/[0-9A-Z]{1,7})?       # / another prefix, callsign or special label (including /MM, /P as well as /EURO or /LGT) possibly
                                          $!x;
 
        # longest callign allowed is 1X11/1Y11XXXXX-11/XXXXXXX
@@ -440,7 +440,7 @@ sub is_latlong
 # is it an ip address?
 sub is_ipaddr
 {
-    return $_[0] =~ /^\d+\.\d+\.\d+\.\d+$/ || $_[0] =~ /^[0-9a-f:]+$/;
+    return $_[0] =~ /^\d+\.\d+\.\d+\.\d+$/ || $_[0] =~ /^[0-9a-f:,]+$/;
 }
 
 # insert an item into a list if it isn't already there returns 1 if there 0 if not
index 168ee16a9a9e9ce1c45cffe3f242b7a3952b1599..666a7d5d4fd160e5d7f284b6ce8408ec16cad2ae 100755 (executable)
@@ -98,7 +98,7 @@ if (-e $lockfn) {
 
 DXUser::init(1);
 create_it();
-DXUser:finish();
+DXUser::finish();
 print "Update of $myalias on cluster $mycall successful\n";
 exit(0);
 
index ff4d3438baa6edf16c852140218aa00982ce2215..8d9551d3db9e1cb366defc6186484a19a741964c 100755 (executable)
@@ -6,7 +6,7 @@
 # examples:-
 # 
 #   watchdbg g1tlh       # watch everything g1tlh does
-#   watchdbg 2 PCPROT       # watch all PCPROT messages + up to 2 lines before
+#   watchdbg -2 PCPROT       # watch all PCPROT messages + up to 2 lines before
 #   watchdbg gb7baa gb7djk   # watch the conversation between BAA and DJK 
 #
 
@@ -41,7 +41,7 @@ my @prev;
 # seek to end of file
 $fh->seek(0, 2);
 for (;;) {
-       my $line = <$fh>;
+       my $line = $fh->getline;
        if ($line) {
                if ($exp) {
                        push @prev, $line;