aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/env
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2007-05-01 16:02:44 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2007-05-01 16:02:44 +0000
commitba174a5e38b1ab764c4a36ef4dd83e80c4add148 (patch)
treee3e0b3658b8df3a905b3117d8535bb15f42c9e80 /usr.bin/env
parent8d497697b2ae8684e3ac94eff8bb9ce60dc14a3e (diff)
Notes
Diffstat (limited to 'usr.bin/env')
-rw-r--r--usr.bin/env/env.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/env/env.c b/usr.bin/env/env.c
index b5866efff530e..815976fe5f7af 100644
--- a/usr.bin/env/env.c
+++ b/usr.bin/env/env.c
@@ -64,7 +64,7 @@ static void usage(void);
int
main(int argc, char **argv)
{
- char *altpath, **ep, **parg;
+ char *altpath, **ep, *p, **parg;
char *cleanenv[1];
int ch, want_clear;
@@ -102,10 +102,10 @@ main(int argc, char **argv)
if (env_verbosity)
fprintf(stderr, "#env clearing environ\n");
}
- for (argv += optind; *argv && strchr(*argv, '=') != NULL; ++argv) {
+ for (argv += optind; *argv && (p = strchr(*argv, '=')); ++argv) {
if (env_verbosity)
fprintf(stderr, "#env setenv:\t%s\n", *argv);
- (void)putenv(strdup(*argv));
+ (void)setenv(*argv, ++p, 1);
}
if (*argv) {
if (altpath)