Mercurial > hg > toybox
changeset 1048:e3ebec880fe6 draft
env - there were 2 segfaults when run on my Ubuntu 12.04 machine:
- one is because eglibc sets environ to NULL on clearenv(). I added check for environ being not NULL when iterating over environment variables
- switched xexec to xexec_optargs because command argument is a pointer to optarg which is freed by xexec.
author | Jacek Bukarewicz <j.bukarewicz@samsung.com> |
---|---|
date | Thu, 05 Sep 2013 04:58:06 -0500 |
parents | d90840f337ea |
children | b89ab13436fa |
files | toys/posix/env.c |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/toys/posix/env.c Thu Sep 05 04:28:40 2013 -0500 +++ b/toys/posix/env.c Thu Sep 05 04:58:06 2013 -0500 @@ -45,7 +45,7 @@ if (!command) { char **ep; - for (ep = environ; *ep; ep++) xputs(*ep); - return; - } else xexec(command); + if (environ) for (ep = environ; *ep; ep++) xputs(*ep); + } else xexec_optargs(command - toys.optargs); + }