switch to > n (currently 10) cycle loop protection since eg tumov's include
[ikiwiki.git] / IkiWiki / Setup.pm
index 63659ce2e03e7147be14063bf13e24278ddab94f..9f210dec896e136c8f9536348fa07626fdda2c9d 100644 (file)
@@ -2,6 +2,7 @@
 
 use warnings;
 use strict;
+use IkiWiki;
 
 package IkiWiki;
 
@@ -9,13 +10,17 @@ sub setup () { # {{{
        my $setup=possibly_foolish_untaint($config{setup});
        delete $config{setup};
        open (IN, $setup) || error("read $setup: $!\n");
-       local $/=undef;
-       my $code=<IN>;
+       my $code;
+       {
+               local $/=undef;
+               $code=<IN>;
+       }
        ($code)=$code=~/(.*)/s;
        close IN;
 
        eval $code;
        error($@) if $@;
+
        exit;
 } #}}}