Merge commit 'baaa848f6c06b0b3a59677d3551e130c65e5fde7' into sipb
[ikiwiki.git] / IkiWiki / Wrapper.pm
index fd6b9c00f358f93e817f6e8b24345ddc571524fe..2f0c95465f31643049944830b29ef83678b59a05 100644 (file)
@@ -101,6 +101,7 @@ EOF
 #include <string.h>
 #include <sys/file.h>
 
+extern char **environ;
 char *newenviron[$#envsave+6];
 int i=0;
 
@@ -121,12 +122,17 @@ $envsave
        newenviron[i++]="HOME=$ENV{HOME}";
        newenviron[i++]="WRAPPED_OPTIONS=$configstring";
 
+#ifdef __TINYC__
        if (clearenv() != 0) {
                perror("clearenv");
                exit(1);
        }
        for (; i>0; i--)
                putenv(newenviron[i-1]);
+#else
+       newenviron[i]=NULL;
+       environ=newenviron;
+#endif
 
        if (setregid(getegid(), -1) != 0 &&
            setregid(getegid(), -1) != 0) {