avoid dups getting into @slavelanguages
authorJoey Hess <joey@kitenet.net>
Fri, 10 Sep 2010 18:12:59 +0000 (14:12 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 10 Sep 2010 18:12:59 +0000 (14:12 -0400)
This could happen if checkconfig was run twice, I think.

IkiWiki/Plugin/po.pm

index d920d36486a7aa88dfbafc5d8bcbcd1049827812..ab39cca121b63f780b31f68d94991a517f5afa5a 100644 (file)
@@ -152,7 +152,7 @@ sub checkconfig () {
        if (ref $config{po_slave_languages} eq 'ARRAY') {
                foreach my $pair (@{$config{po_slave_languages}}) {
                        my ($code, $name)=splitlangpair($pair);
-                       if (defined $code) {
+                       if (defined $code && ! exists $slavelanguages{$code}) {
                                push @slavelanguages, $code;
                                $slavelanguages{$code} = $name;
                        }