Work around perl $_ scoping nonsense that caused breakage when loading external plugins.

master
Joey Hess 2008-08-29 18:40:41 -04:00
parent a8d9f1c5cd
commit 75a096d056
3 changed files with 12 additions and 1 deletions

View File

@ -471,7 +471,9 @@ sub loadplugins () { #{{{
unshift @INC, possibly_foolish_untaint($config{libdir}); unshift @INC, possibly_foolish_untaint($config{libdir});
} }
loadplugin($_) foreach @{$config{default_plugins}}, @{$config{add_plugins}}; foreach my $plugin (@{$config{default_plugins}}, @{$config{add_plugins}}) {
loadplugin($plugin);
}
if ($config{rcs}) { if ($config{rcs}) {
if (exists $IkiWiki::hooks{rcs}) { if (exists $IkiWiki::hooks{rcs}) {

2
debian/changelog vendored
View File

@ -4,6 +4,8 @@ ikiwiki (2.63) UNRELEASED; urgency=low
* Typo. Closes: #497003 * Typo. Closes: #497003
* Ignore failure to install files into /etc, in case install is running as * Ignore failure to install files into /etc, in case install is running as
non-root. non-root.
* Work around perl $_ scoping nonsense that caused breakage when loading
external plugins.
-- Joey Hess <joeyh@debian.org> Thu, 28 Aug 2008 16:08:18 -0400 -- Joey Hess <joeyh@debian.org> Thu, 28 Aug 2008 16:08:18 -0400

View File

@ -14,6 +14,13 @@
**patch comment:** solves the problem on 2.61. as these are the first lines of perl i've knowingly written, i can not explain what exactly was happening there. **patch comment:** solves the problem on 2.61. as these are the first lines of perl i've knowingly written, i can not explain what exactly was happening there.
> Perl's `$_` handling is the worst wart on it, or possibly any language.
> Here it's an alias to the actual value in the array, and when deep
> in the external plugin load code something resets `$_` to a different
> value, the alias remains and it changes the value at a distance.
>
> Thanks for the excellent problem report, [[fixed|done]]. --[[Joey]]
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
diff --git a/IkiWiki.pm b/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm
index e476521..d43abd4 100644 index e476521..d43abd4 100644