aboutsummaryrefslogtreecommitdiff
path: root/coreutils/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/env.c')
-rw-r--r--coreutils/env.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/coreutils/env.c b/coreutils/env.c
index db13b3aed..eb761e9e9 100644
--- a/coreutils/env.c
+++ b/coreutils/env.c
@@ -44,20 +44,13 @@ extern int env_main(int argc, char** argv)
44{ 44{
45 char **ep, *p; 45 char **ep, *p;
46 char *cleanenv[1] = { NULL }; 46 char *cleanenv[1] = { NULL };
47 int ch; 47 unsigned long opt;
48 48
49 while ((ch = getopt(argc, argv, "iu:")) > 0) { 49 opt = bb_getopt_ulflags(argc, argv, "iu:", &p);
50 switch(ch) { 50 if(opt & 1)
51 case 'i':
52 environ = cleanenv; 51 environ = cleanenv;
53 break; 52 if(opt & 2)
54 case 'u': 53 unsetenv(p);
55 unsetenv(optarg);
56 break;
57 default:
58 bb_show_usage();
59 }
60 }
61 54
62 argv += optind; 55 argv += optind;
63 56