Pass along wrapper args to ikiwiki, then handle the "cvs add dir"
[ikiwiki.git] / IkiWiki / Wrapper.pm
index 8a6340f58c4f1ec5a6b77587672e0721f0f250c7..4d92716ff0d31a523e855b7fe86d76abb326709f 100644 (file)
@@ -93,10 +93,7 @@ EOF
        $configstring=~s/"/\\"/g;
        $configstring=~s/\n/\\n/g;
        
-       #translators: The first parameter is a filename, and the second is
-       #translators: a (probably not translated) error message.
-       open(OUT, ">$wrapper.c") || error(sprintf(gettext("failed to write %s: %s"), "$wrapper.c", $!));;
-       print OUT <<"EOF";
+       writefile(basename("$wrapper.c"), dirname($wrapper), <<"EOF");
 /* A wrapper for ikiwiki, can be safely made suid. */
 #include <stdio.h>
 #include <sys/types.h>
@@ -142,7 +139,7 @@ $envsave
        }
 
 $pre_exec
-       execl("$this", "$this", NULL);
+       execv("$this", argv);
        perror("exec $this");
        exit(1);
 }