chiark / gitweb /
Normalise commodity name case (from uploads)
[ypp-sc-tools.web-live.git] / yarrg / commod-results-processor
index 3482381224748026b3741bdf233031d61a08e8a8..fe05fb8722c207acb14c44f63d0d15b31a20bf17 100755 (executable)
@@ -24,6 +24,7 @@
 # are used without permission.  This program is not endorsed or
 # sponsored by Three Rings.
 
+BEGIN { unshift @INC, qw(.) }
 
 use strict (qw(vars));
 use HTTP::Request;
@@ -550,10 +551,11 @@ sub main__uploadpctb () {
 
     my $islandid;
     while ($resptxt =~
- m/^islands\[\d+\]\[\d+\]\=new\s+option\(\"(.*)\"\,(\d+)\)\s*$/mig
+ m/^islands\[(\d+)\]\[\d+\]\=new\s+option\(\"(.*)\"\,(\d+)\)\s*$/mig
           ) {
-       next unless $1 eq $island;
-       $islandid= $2;
+       next unless $1 eq $oceanids[0];
+       next unless $2 eq $island;
+       $islandid= $3;
     }
     defined $islandid or die;