summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-05-05 14:50:26 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-05-05 14:50:26 -0400
commita7b8069b9dd1921275ef24752a65005c15d0868e (patch)
tree69554add18d22840bb042ff0637faf92cf6cc159
parentad44c479779066dbde3ae26667532ec213fbd85d (diff)
avoid strange FreeBSD problem
<mxey> I have a weird problem with Ikiwiki on FreeBSD: When rendering this page <http://rafb.net/p/zmfROX86.html>, I get "ikiwiki.setup: Modification of a read-only value attempted at /usr/local/lib/perl5/site_perl/5.8.8/IkiWiki.pm line 1300.". And converting the constructors to not operate on the parameters directly but use lexical variables fixed it. Not sure exactly when this occurs.
-rw-r--r--IkiWiki.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index f5cf8ba96..98145a585 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1287,7 +1287,9 @@ use overload ( #{{{
); #}}}
sub new { #{{{
- return bless \$_[1], $_[0];
+ my $class = shift;
+ my $value = shift;
+ return bless \$value, $class;
} #}}}
package IkiWiki::SuccessReason;
@@ -1300,7 +1302,9 @@ use overload ( #{{{
); #}}}
sub new { #{{{
- return bless \$_[1], $_[0];
+ my $class = shift;
+ my $value = shift;
+ return bless \$value, $class;
}; #}}}
package IkiWiki::PageSpec;