passwd: micro-optimization

This commit is contained in:
Denis Vlasenko 2006-11-30 23:13:59 +00:00
parent eb98be02ac
commit 4c87d4f242

View File

@ -252,7 +252,7 @@ int passwd_main(int argc, char **argv)
OPT_delete = 0x8, /* -d - delete password */ OPT_delete = 0x8, /* -d - delete password */
OPT_lud = 0xe, OPT_lud = 0xe,
STATE_ALGO_md5 = 0x10, STATE_ALGO_md5 = 0x10,
STATE_ALGO_des = 0x20, /*STATE_ALGO_des = 0x20, not yet needed */
}; };
unsigned opt; unsigned opt;
char *opt_a = ""; char *opt_a = "";
@ -269,10 +269,10 @@ int passwd_main(int argc, char **argv)
argc -= optind; argc -= optind;
argv += optind; argv += optind;
if (strcasecmp(opt_a, "des") == 0) /* -a */ if (strcasecmp(opt_a, "des") != 0) /* -a */
opt |= STATE_ALGO_des;
else
opt |= STATE_ALGO_md5; opt |= STATE_ALGO_md5;
//else
// opt |= STATE_ALGO_des;
myuid = getuid(); myuid = getuid();
if ((opt & OPT_lud) && (!argc || myuid)) if ((opt & OPT_lud) && (!argc || myuid))
bb_show_usage(); bb_show_usage();