aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2010-03-18 17:44:46 -0400
committerJoey Hess <joey@gnu.kitenet.net>2010-03-18 17:44:46 -0400
commitdddd6aa99055d8505f73e39b12f049633d9cb4c3 (patch)
tree88ca0515778e95325c62357cf594f6e0a83474b3 /IkiWiki
parentb4ab74e722aaca406922fe614d9e6541dd87c3bf (diff)
downloadikiwiki-dddd6aa99055d8505f73e39b12f049633d9cb4c3.tar
ikiwiki-dddd6aa99055d8505f73e39b12f049633d9cb4c3.tar.gz
Allow wrappers to be built using tcc.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Wrapper.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm
index 830b04877..f175b4a0b 100644
--- a/IkiWiki/Wrapper.pm
+++ b/IkiWiki/Wrapper.pm
@@ -101,7 +101,6 @@ EOF
#include <string.h>
#include <sys/file.h>
-extern char **environ;
char *newenviron[$#envsave+6];
int i=0;
@@ -121,8 +120,13 @@ $check_commit_hook
$envsave
newenviron[i++]="HOME=$ENV{HOME}";
newenviron[i++]="WRAPPED_OPTIONS=$configstring";
- newenviron[i]=NULL;
- environ=newenviron;
+
+ if (clearenv() != 0) {
+ perror("clearenv");
+ exit(1);
+ }
+ for (; i>0; i--)
+ putenv(newenviron[i-1]);
if (setregid(getegid(), -1) != 0 &&
setregid(getegid(), -1) != 0) {