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)
{
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;