chiark / gitweb /
normalise: Fix to cope with no options on candidate definition
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Apr 2020 19:46:39 +0000 (20:46 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Apr 2020 19:46:39 +0000 (20:46 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
normalise

index 0af8f19623d021aa3d9c34f912fc3be0584fc908..ff5c3c22abd5b50821473a2cad6da580685960cd 100755 (executable)
--- a/normalise
+++ b/normalise
@@ -96,9 +96,9 @@ while (<>) {
     s/\s+$//;
     if (m/^\|/) {
        push @options, normalise_opts_list $', 'Election';
     s/\s+$//;
     if (m/^\|/) {
        push @options, normalise_opts_list $', 'Election';
-    } elsif (m/^($candvoter_re?)\s*=\s*([^|]+?)\s*\|(.*)?$/o) {
+    } elsif (m/^($candvoter_re?)\s*=\s*([^|]+?)\s*(?:\|(.*))?$/o) {
        use Data::Dumper;
        use Data::Dumper;
-print STDERR Dumper($1,$2,$3);
+#print STDERR Dumper($1,$2,$3);
        my ($cand,$desc,$opts) = ($1,$2,$3);
        push @{ $candidates{$cand}{Opts} }, normalise_opts $opts, 'Candidate';
        setcanddesc $cand, $desc;
        my ($cand,$desc,$opts) = ($1,$2,$3);
        push @{ $candidates{$cand}{Opts} }, normalise_opts $opts, 'Candidate';
        setcanddesc $cand, $desc;