]> git.donarmstrong.com Git - debian-ctte.git/blobdiff - scripts/pocket-devotee
pocket-devotee: Fix regex with non-greedy option name to allow for majorities to...
[debian-ctte.git] / scripts / pocket-devotee
index e2e667880c277ac65a0b83ef35f4ce9251189ff2..5e7b3ec59058a3f1c798661d3883c86f376a96fc 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,
@@ -285,7 +285,7 @@ EOF
       printf {$RESULTS} "Option %s  ", $order_to_options{$row + 1}{key};
       for my $col (0..($max_choices - 1)) {
           if ($row == $col) {
-              printf {$RESULTS} "      ", $Beat_Matrix[$row][$col];
+              print {$RESULTS} "      ";
           } else {
               printf {$RESULTS} " % 4d ", $Beat_Matrix[$row][$col];
           }