avoid clobbering origsub if checkconfig runs more than once

checkconfig can run more than once in a single ikiwiki run if setup is
building wrappers. That clobbered the origsub value for bestlink, leading
to infinite recursion
master
Joey Hess 2009-08-28 19:15:25 -04:00
parent 2ba54735ce
commit ec26a96193
1 changed files with 4 additions and 2 deletions

View File

@ -152,9 +152,11 @@ sub checkconfig () {
$config{po_link_to}='default'; $config{po_link_to}='default';
} }
unless ($config{po_link_to} eq 'default') { unless ($config{po_link_to} eq 'default') {
if (! exists $origsubs{'bestlink'}) {
$origsubs{'bestlink'}=\&IkiWiki::bestlink; $origsubs{'bestlink'}=\&IkiWiki::bestlink;
inject(name => "IkiWiki::bestlink", call => \&mybestlink); inject(name => "IkiWiki::bestlink", call => \&mybestlink);
} }
}
push @{$config{wiki_file_prune_regexps}}, qr/\.pot$/; push @{$config{wiki_file_prune_regexps}}, qr/\.pot$/;