]> git.donarmstrong.com Git - debian-ctte.git/blobdiff - scripts/pocket-devotee
actually strip out spaces from the option name
[debian-ctte.git] / scripts / pocket-devotee
index 64075c79113684a5407c2573fa58192120c047b1..232f316c57c1b21e63df105784faa2bb17db7323 100755 (executable)
@@ -108,7 +108,7 @@ sub main {
     }
     my @options;
     for my $option (@{$options{option}}) {
-        my ($key,$name,$majority) = $option =~ /^\s*([^:]+)\s*:\s*(.+?)\s*(?::(\d+))?$/;
+        my ($key,$name,$majority) = $option =~ /^\s*([^:]+?)\s*:\s*(.+?)\s*(?::(\d+))?$/;
         $majority //= 1;
         push @options,{key => $key,
                        name => $name,
@@ -340,7 +340,7 @@ EOM
       my $ratio = 1.0 * $Beat_Matrix[$i][$max_choices - 1] /
           $Beat_Matrix[$max_choices - 1][$i];
       $Ratio{$i} = sprintf("%.2f", $ratio);
-      if ($ratio < $order_to_options{$i + 1}{majority} and $Beat_Matrix[$i][$max_choices - 1] or $ratio <= 1) {
+      if ($ratio < $order_to_options{$i + 1}{majority} or $ratio <= 1) {
           # If the next line is commented out, we get a more verbose set of results
           $Drop{$i}++;
           print {$RESULTS} "Dropping Option ", $order_to_options{$i + 1}{key},