diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2010-03-18 17:44:46 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2010-03-18 17:44:46 -0400 |
commit | dddd6aa99055d8505f73e39b12f049633d9cb4c3 (patch) | |
tree | 88ca0515778e95325c62357cf594f6e0a83474b3 /IkiWiki | |
parent | b4ab74e722aaca406922fe614d9e6541dd87c3bf (diff) | |
download | ikiwiki-dddd6aa99055d8505f73e39b12f049633d9cb4c3.tar ikiwiki-dddd6aa99055d8505f73e39b12f049633d9cb4c3.tar.gz |
Allow wrappers to be built using tcc.
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Wrapper.pm | 10 |
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) { |