fix small crash with Spot::dup
authorDirk Koopman <djk@tobit.co.uk>
Sat, 8 Mar 2014 00:18:18 +0000 (00:18 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Sat, 8 Mar 2014 00:18:18 +0000 (00:18 +0000)
This may have something to do with the new wpxloc.raw format that
I am now using (erm.. testing). But if I check for a a duplicate of
the prefix in the remarks, and that "prefix" (char string length <= 4)
contains a space, Spot::dup crashes. Intermittently.

Changes
cmd/show/prefix.pl
perl/Spot.pm
perl/Version.pm

diff --git a/Changes b/Changes
index 42dd9026c6f5ecc6c95e8b4269c4f9f1f09c151b..d3a17adfc94b0a3019be0612db48af8b7ecd875b 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
 07Mar14=======================================================================
 1. Add new version of wpxloc.raw 
+2. Fix a small crash with Spot::dup
 12Jan14=======================================================================
 1. Fix minor issue with dx command when used in a script, as found by
    Christian Furst.
index e8e939e6d02cabd9e52b79b568d280ce1f151da5..1689d63a9d213ad01916f8063cf66b5e4704b7f6 100644 (file)
@@ -10,10 +10,13 @@ my @list = split /\s+/, $line;      # generate a list of callsigns
 my $l;
 my @out;
 
+#$DB::single = 1;
+
 #print "line: $line\n";
 foreach $l (@list) {
        my @ans = Prefix::extract($l);
        next if !@ans;
+#      dbg(join(', ', @ans));
        my $pre = shift @ans;
        my $a;
        foreach $a (@ans) {
index 7fcba6d1d045a005d0693306a72b0d3a2307b9f3..f6b14564ff98cc86ea2b537830274e453d1f7ff5 100644 (file)
@@ -403,7 +403,7 @@ sub dup
        $text =~ s/\%([0-9A-F][0-9A-F])/chr(hex($1))/eg;
        $text = uc unpad($text);
        if ($cty && $text && length $text <= 4) {
-               unless ($text =~ /^C?Q/ || $text =~ /^\d+$/) {
+               unless ($text =~ /^C?Q/ || $text =~ /^\d+$/ || $text =~ /\s/) {
                        my @try = Prefix::cty_data($text);
                        $text = "" if $cty == $try[0];
                }
index 64bbf7eb3276f38fedab8100a8e422ef05393924..7033921195744d8d9eed3205deb8d89febad8f70 100644 (file)
@@ -11,7 +11,7 @@ use vars qw($version $subversion $build $gitversion);
 
 $version = '1.55';
 $subversion = '0';
-$build = '142';
-$gitversion = '210ee86';
+$build = '143';
+$gitversion = '3b2eb09';
 
 1;