Move start_stop_daemon to debianutils.
[oweals/busybox.git] / coreutils / env.c
index db13b3aed977b65b8fdec1ead5f8f15cc5388f40..a07bd324cd986be80be5e1a080bb6959ad629b60 100644 (file)
@@ -21,7 +21,7 @@
  *
  * Original copyright notice is retained at the end of this file.
  *
- * Modified for BusyBox by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
+ * Modified for BusyBox by Erik Andersen <andersen@codepoet.org>
  */
 
 /* BB_AUDIT SUSv3 compliant */
@@ -44,20 +44,13 @@ extern int env_main(int argc, char** argv)
 {
        char **ep, *p;
        char *cleanenv[1] = { NULL };
-       int ch;
+       unsigned long opt;
 
-       while ((ch = getopt(argc, argv, "iu:")) > 0) {
-               switch(ch) {
-               case 'i':
+       opt = bb_getopt_ulflags(argc, argv, "iu:", &p);
+       if(opt & 1)
                        environ = cleanenv;
-                       break;
-               case 'u':
-                       unsetenv(optarg);
-                       break;
-               default:
-                       bb_show_usage();
-               }
-       }
+       if(opt & 2)
+               unsetenv(p);
 
        argv += optind;