1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-26 18:01:03 +02:00

19971: Fix environment nastiness in zexecve()

This commit is contained in:
Peter Stephenson 2004-05-21 11:19:30 +00:00
parent ac3bedf522
commit 665b0950c6
3 changed files with 8 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2004-05-21 Peter Stephenson <pws@csr.com>
* 19971: Src/exec.c, Src/params.c: use putenv to put "_"
into exec'd environment, avoiding horrific hack.
2004-05-20 Wayne Davison <wayned@users.sourceforge.net>
* 19962: Src/builtin.c, Src/hist.c, Doc/Zsh/builtins.yo,

View file

@ -352,18 +352,13 @@ zexecve(char *pth, char **argv)
for (eep = argv; *eep; eep++)
if (*eep != pth)
unmetafy(*eep, NULL);
for (eep = environ; *eep; eep++)
if (**eep == '_' && (*eep)[1] == '=')
break;
buf[0] = '_';
buf[1] = '=';
if (*pth == '/')
strcpy(buf + 2, pth);
else
sprintf(buf + 2, "%s/%s", pwd, pth);
if (!*eep)
eep[1] = NULL;
*eep = buf;
zputenv(buf);
closedumps();
execve(pth, argv, environ);

View file

@ -3297,7 +3297,8 @@ arrfixenv(char *s, char **t)
}
static int
/**/
int
zputenv(char *str)
{
#ifdef HAVE_PUTENV