diff options
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) { |