env won't run a command with an = in its name. This is documented as a
bug, but it's easily fixed in a backwards compatible way.

Index: env.1
===================================================================
RCS file: /cvs/src/usr.bin/env/env.1,v
retrieving revision 1.19
diff -u -p -r1.19 env.1
--- env.1       8 Mar 2014 01:42:17 -0000       1.19
+++ env.1       11 Jan 2015 17:32:32 -0000
@@ -119,9 +119,3 @@ specification.
 The historic
 .Fl
 option has been deprecated but is still supported in this implementation.
-.Sh BUGS
-.Nm
-doesn't handle commands with equal
-.Pq Sq =
-signs in their
-names, for obvious reasons.
Index: env.c
===================================================================
RCS file: /cvs/src/usr.bin/env/env.c,v
retrieving revision 1.15
diff -u -p -r1.15 env.c
--- env.c       8 Mar 2014 00:09:20 -0000       1.15
+++ env.c       11 Jan 2015 17:32:07 -0000
@@ -69,6 +69,8 @@ main(int argc, char *argv[])
                        err(126, "setenv");
                }
        }
+       if (strcmp(*argv, "--") == 0)
+               argv++;
 
        if (*argv) {
                /*

Reply via email to