summaryrefslogtreecommitdiff
path: root/usr.bin/env/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/env/env.c')
-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 815976fe5f7a..b5866efff530 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, *p, **parg;
+ char *altpath, **ep, **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 && (p = strchr(*argv, '=')); ++argv) {
+ for (argv += optind; *argv && strchr(*argv, '=') != NULL; ++argv) {
if (env_verbosity)
fprintf(stderr, "#env setenv:\t%s\n", *argv);
- (void)setenv(*argv, ++p, 1);
+ (void)putenv(strdup(*argv));
}
if (*argv) {
if (altpath)