]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/monotone.pm
po: avoid crash when page is empty
[git.ikiwiki.info.git] / IkiWiki / Plugin / monotone.pm
index bdb564a71c30befd8d219e0796d58e5d52b7dcb3..9502804f19637e1ec905b88758091f93d2c0953c 100644 (file)
@@ -228,7 +228,7 @@ sub read_certs ($$) {
        my @ret;
 
        my $line = $results[0];
        my @ret;
 
        my $line = $results[0];
-       while ($line =~ m/\s+key\s"(.*?)"\nsignature\s"(ok|bad|unknown)"\n\s+name\s"(.*?)"\n\s+value\s"(.*?)"\n\s+trust\s"(trusted|untrusted)"\n/sg) {
+       while ($line =~ m/\s+key\s["\[](.*?)[\]"]\nsignature\s"(ok|bad|unknown)"\n\s+name\s"(.*?)"\n\s+value\s"(.*?)"\n\s+trust\s"(trusted|untrusted)"\n/sg) {
                push @ret, {
                        key => $1,
                        signature => $2,
                push @ret, {
                        key => $1,
                        signature => $2,
@@ -558,7 +558,8 @@ sub rcs_recentchanges ($) {
                                        # from the changelog
                                        if ($cert->{key} eq $config{mtnkey}) {
                                                $committype = "web";
                                        # from the changelog
                                        if ($cert->{key} eq $config{mtnkey}) {
                                                $committype = "web";
-                                       } else {
+                                       }
+                                       else {
                                                $committype = "mtn";
                                        }
                                } elsif ($cert->{name} eq "date") {
                                                $committype = "mtn";
                                        }
                                } elsif ($cert->{name} eq "date") {
@@ -575,13 +576,12 @@ sub rcs_recentchanges ($) {
                }
                
                my @changed_files = get_changed_files($automator, $rev);
                }
                
                my @changed_files = get_changed_files($automator, $rev);
-               my $file;
                
                my ($out, $err) = $automator->call("parents", $rev);
                my @parents = ($out =~ m/^($sha1_pattern)$/);
                my $parent = $parents[0];
 
                
                my ($out, $err) = $automator->call("parents", $rev);
                my @parents = ($out =~ m/^($sha1_pattern)$/);
                my $parent = $parents[0];
 
-               foreach $file (@changed_files) {
+               foreach my $file (@changed_files) {
                        next unless length $file;
                        
                        if (defined $config{diffurl} and (@parents == 1)) {
                        next unless length $file;
                        
                        if (defined $config{diffurl} and (@parents == 1)) {