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