[issue1337] HEAD can't build 2.2-RELEASE

Thomas Nikolajsen (via DragonFly issue tracker) sinknull at crater.dragonflybsd.org
Fri Apr 17 04:36:59 PDT 2009


Thomas Nikolajsen <thomas.nikolajsen at mail.dk> added the comment:

On HEAD building 2.0-RELEASE with your patch applied doesn't fail.

I will commit patch in case to 2.2-RELEASE & 2.0-RELEASE in one week
if no one objects.

 -thomas

_____________________________________________________
DragonFly issue tracker <bugs at lists.dragonflybsd.org>
<http://bugs.dragonflybsd.org/issue1337>
_____________________________________________________diff --git a/usr.bin/env/env.c b/usr.bin/env/env.c
index 468649b..8b59033 100644
--- a/usr.bin/env/env.c
+++ b/usr.bin/env/env.c
@@ -65,8 +65,10 @@ main(int argc, char **argv)
 			usage();
 		}
 	for (argv += optind; *argv && (p = strchr(*argv, '=')); ++argv) {
-		if (setenv(*argv, ++p, 1) == -1)
-			err(1, "setenv: cannot set %s=%s", *argv, p);
+		*p = '\0';
+		if (setenv(*argv, p + 1, 1) == -1)
+			err(1, "setenv: cannot set %s=%s", *argv, p + 1);
+		*p = '=';
 	}
 
 	if (*argv) {




More information about the Bugs mailing list