X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/dddd6aa99055d8505f73e39b12f049633d9cb4c3..8496dd9fb405eda149995615ead0a94a83298b91:/IkiWiki/Wrapper.pm?ds=sidebyside diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index f175b4a0b..73f0896e8 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -101,6 +101,7 @@ EOF #include #include +extern char **environ; char *newenviron[$#envsave+6]; int i=0; @@ -121,12 +122,18 @@ $envsave newenviron[i++]="HOME=$ENV{HOME}"; newenviron[i++]="WRAPPED_OPTIONS=$configstring"; +#ifdef __TINYC__ + /* old tcc versions do not support modifying environ directly */ 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) {