]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Wrapper.pm
fix a bug that doubled the search box
[ikiwiki.git] / IkiWiki / Wrapper.pm
index e5f718f710422f71c425df5f74070697a45123cd..7d27abd06a6e742b66349115ef4107136f36e11f 100644 (file)
@@ -36,7 +36,7 @@ sub gen_wrapper () { #{{{
                asprintf(&newenviron[i++], "%s=%s", "$var", s);
 EOF
        }
                asprintf(&newenviron[i++], "%s=%s", "$var", s);
 EOF
        }
-       if ($config{svn} && $config{notify}) {
+       if ($config{rcs} eq "svn" && $config{notify}) {
                # Support running directly as hooks/post-commit by passing
                # $2 in REV in the environment.
                $envsave.=<<"EOF"
                # Support running directly as hooks/post-commit by passing
                # $2 in REV in the environment.
                $envsave.=<<"EOF"
@@ -47,10 +47,15 @@ EOF
 EOF
        }
        
 EOF
        }
        
+       # This is only set by plugins, which append to it on startup, so
+       # avoid storing it in the wrapper.
+       $config{headercontent}="";
+       
        $Data::Dumper::Indent=0; # no newlines
        my $configstring=Data::Dumper->Dump([\%config], ['*config']);
        $configstring=~s/\\/\\\\/g;
        $configstring=~s/"/\\"/g;
        $Data::Dumper::Indent=0; # no newlines
        my $configstring=Data::Dumper->Dump([\%config], ['*config']);
        $configstring=~s/\\/\\\\/g;
        $configstring=~s/"/\\"/g;
+       $configstring=~s/\n/\\\n/g;
        
        open(OUT, ">$wrapper.c") || error("failed to write $wrapper.c: $!");;
        print OUT <<"EOF";
        
        open(OUT, ">$wrapper.c") || error("failed to write $wrapper.c: $!");;
        print OUT <<"EOF";