]> dxcluster.org Git - spider.git/commitdiff
remove -0 on callsigns
authorminima <minima>
Sat, 28 Oct 2000 19:04:12 +0000 (19:04 +0000)
committerminima <minima>
Sat, 28 Oct 2000 19:04:12 +0000 (19:04 +0000)
perl/client.pl
src/client.c

index 740a9e7211d45bb27c4dfadf8cebe3f0243e0e7c..b84945783155cd70a36685524ab78bf50fd98735 100755 (executable)
@@ -477,6 +477,7 @@ if ($connsort eq "connect") {
 setmode();
 
 # adjust the callsign if it has an SSID, SSID <= 8 are legal > 8 are netrom connections
+$call =~ s/-0$//;     # strip off -0 as this is equiv to just call on its own
 my ($scall, $ssid) = split /-/, $call;
 $ssid = undef unless $ssid && $ssid =~ /^\d+$/;  
 if ($ssid) {
index 74670241615d1ce8d12fca3fbe3b17b17770b4a2..167ef647acacc5101cf152223117d25e9023f62c 100644 (file)
@@ -112,10 +112,10 @@ myregex_t iscallreg[] = {         /* regexes to determine whether this is a reasonable
                "^[0-9]+[A-Z]+[0-9]+[A-Z]+[1-9]?$", 0          /* 2E0AAA 2E0AAA1 */
        },
        {
-               "^[A-Z]+[0-9]+[A-Z]+-[1-9]$", 0                /* G1TLH-2 */
+               "^[A-Z]+[0-9]+[A-Z]+-[0-9]$", 0                /* G1TLH-2 */
        },
        {
-               "^[0-9]+[A-Z]+[0-9]+[A-Z]+-[1-9]$", 0          /* 2E0AAA-2 */
+               "^[0-9]+[A-Z]+[0-9]+[A-Z]+-[0-9]$", 0          /* 2E0AAA-2 */
        },
        {
                "^[A-Z]+[0-9]+[A-Z]+-1[0-5]$", 0               /* G1TLH-11 */
@@ -613,6 +613,11 @@ void process_stdin()
                        if (!iscallsign(call)) {
                                die("Sorry, %s isn't a valid callsign", call);
                        }
+                       
+                       /* strip off a '-0' at the end */
+                       i = strlen(call);
+                       if (call[i-1] == '0' && call[i-2] == '-')
+                               call[i-2] = 0;
 
                        alarm(0);
                        signal(SIGALRM, SIG_IGN);
@@ -879,12 +884,18 @@ main(int argc, char *argv[])
                send_text(in, "login: ", 7, 0);
                chgstate(WAITLOGIN);
        } else {
-
+               int i;
+               
                /* check the callsign against the regexes */
                if (!iscallsign(call)) {
                        die("Sorry, %s isn't a valid callsign", call);
                }
 
+               /* strip off a '-0' at the end */
+               i = strlen(call);
+               if (call[i-1] == '0' && call[i-2] == '-')
+                       call[i-2] = 0;
+               
                /* tell the cluster who I am */
                send_msg(node, 'A', connsort, strlen(connsort));