Undo r1.14 to env.c. While it is unusual for environment variables to

start with a '/', they are more supported (by POSIX and SUSv3) than
filenames which have an '=' in them.

Noticed by:	tjr
Approved by:	re (blanket `env')
This commit is contained in:
Garance A Drosehn 2005-06-21 19:38:26 +00:00
parent b6c9debcf0
commit 2f739d3c1a
2 changed files with 2 additions and 7 deletions

6
usr.bin/env/env.1 vendored
View File

@ -445,11 +445,7 @@ utility does not handle values of
.Ar utility
which have an equals sign
.Pq Ql =
in their name (for obvious reasons), unless the
.Ar utility
name begins with a
.Ql /
character.
in their name, for obvious reasons.
.Pp
The
.Nm

3
usr.bin/env/env.c vendored
View File

@ -102,8 +102,7 @@ main(int argc, char **argv)
if (env_verbosity)
fprintf(stderr, "#env clearing environ\n");
}
for (argv += optind; *argv && (**argv != '/') && (p = strchr(*argv,
'=')); ++argv) {
for (argv += optind; *argv && (p = strchr(*argv, '=')); ++argv) {
if (env_verbosity)
fprintf(stderr, "#env setenv:\t%s\n", *argv);
(void)setenv(*argv, ++p, 1);