From 52265e9d360caa10d61ab9689424dc19225a04fd Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 2 Mar 2012 20:18:02 -0600 Subject: Add copyright notice, fluff out help text, use xexec(). --- toys/env.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/toys/env.c b/toys/env.c index b23d98a0..7cda85f9 100644 --- a/toys/env.c +++ b/toys/env.c @@ -1,4 +1,8 @@ /* vi: set sw=4 ts=4: + * + * env.c - Set the environment for command invocation. + * + * Copyright 2012 Tryn Mirell * env.c USE_ENV(NEWTOY(env, "^i", TOYFLAG_USR|TOYFLAG_BIN)) @@ -7,9 +11,11 @@ config ENV bool "env" default y help - usage: env [-i] [FOO=BAR...] [command [option...]] + usage: env [-i] [NAME=VALUE...] [command [option...]] - Set the environment for command invocation + Set the environment for command invocation. + + -i Clear existing environment. */ #include "toys.h" @@ -40,8 +46,7 @@ void env_main(void) if (!command) { char **ep; - for (ep = environ; *ep; ep++) - xputs(*ep); + for (ep = environ; *ep; ep++) xputs(*ep); return; - } else execvp(*command, command); + } else xexec(command); } -- cgit v1.2.3