From: Karel Zak Date: Wed, 5 Sep 2012 09:26:20 +0000 (+0200) Subject: su: move long options to main() X-Git-Tag: v2.23-rc1~723 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bda67d64de47bd6e3c04bb163e76517e78dfd5db;p=thirdparty%2Futil-linux.git su: move long options to main() Signed-off-by: Karel Zak --- diff --git a/login-utils/su-common.c b/login-utils/su-common.c index 65ecc24af7..23ad57dc3e 100644 --- a/login-utils/su-common.c +++ b/login-utils/su-common.c @@ -115,21 +115,6 @@ static pam_handle_t *pamh = NULL; static int restricted = 1; /* zero for root user */ -static struct option const longopts[] = -{ - {"command", required_argument, NULL, 'c'}, - {"session-command", required_argument, NULL, 'C'}, - {"fast", no_argument, NULL, 'f'}, - {"login", no_argument, NULL, 'l'}, - {"preserve-environment", no_argument, NULL, 'p'}, - {"shell", required_argument, NULL, 's'}, - {"group", required_argument, NULL, 'g'}, - {"supp-group", required_argument, NULL, 'G'}, - {"help", no_argument, 0, 'h'}, - {"version", no_argument, 0, 'V'}, - {NULL, 0, NULL, 0} -}; - static struct passwd * current_getpwuid(void) @@ -780,6 +765,20 @@ su_main (int argc, char **argv, int mode) int num_supp_groups = 0; int use_gid = 0; + static const struct option longopts[] = { + {"command", required_argument, NULL, 'c'}, + {"session-command", required_argument, NULL, 'C'}, + {"fast", no_argument, NULL, 'f'}, + {"login", no_argument, NULL, 'l'}, + {"preserve-environment", no_argument, NULL, 'p'}, + {"shell", required_argument, NULL, 's'}, + {"group", required_argument, NULL, 'g'}, + {"supp-group", required_argument, NULL, 'G'}, + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, + {NULL, 0, NULL, 0} + }; + setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE);