* src/faillog.c, src/chage.c, src/newusers.c, src/su.c: The getopt
index of long options is not used.
This commit is contained in:
parent
7b8c4952a8
commit
6eb0500d3d
@ -1,3 +1,8 @@
|
||||
2011-10-30 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* src/faillog.c, src/chage.c, src/newusers.c, src/su.c: The getopt
|
||||
index of long options is not used.
|
||||
|
||||
2011-10-29 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* lib/prototypes.h, libmisc/Makefile.am, libmisc/root_flag.c,
|
||||
|
@ -381,7 +381,6 @@ static void process_flags (int argc, char **argv)
|
||||
/*
|
||||
* Parse the command line options.
|
||||
*/
|
||||
int option_index = 0;
|
||||
int c;
|
||||
static struct option long_options[] = {
|
||||
{"lastday", required_argument, NULL, 'd'},
|
||||
@ -395,9 +394,8 @@ static void process_flags (int argc, char **argv)
|
||||
{NULL, 0, NULL, '\0'}
|
||||
};
|
||||
|
||||
while ((c =
|
||||
getopt_long (argc, argv, "d:E:hI:lm:M:W:", long_options,
|
||||
&option_index)) != -1) {
|
||||
while ((c = getopt_long (argc, argv, "d:E:hI:lm:M:W:",
|
||||
long_options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case 'd':
|
||||
dflg = true;
|
||||
|
@ -567,7 +567,6 @@ int main (int argc, char **argv)
|
||||
(void) textdomain (PACKAGE);
|
||||
|
||||
{
|
||||
int option_index = 0;
|
||||
int c;
|
||||
static struct option long_options[] = {
|
||||
{"all", no_argument, NULL, 'a'},
|
||||
@ -580,7 +579,7 @@ int main (int argc, char **argv)
|
||||
{NULL, 0, NULL, '\0'}
|
||||
};
|
||||
while ((c = getopt_long (argc, argv, "ahl:m:rt:u:",
|
||||
long_options, &option_index)) != -1) {
|
||||
long_options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
aflg = true;
|
||||
|
@ -523,7 +523,6 @@ static int add_passwd (struct passwd *pwd, const char *password)
|
||||
*/
|
||||
static void process_flags (int argc, char **argv)
|
||||
{
|
||||
int option_index = 0;
|
||||
int c;
|
||||
static struct option long_options[] = {
|
||||
#ifndef USE_PAM
|
||||
@ -547,7 +546,7 @@ static void process_flags (int argc, char **argv)
|
||||
#else /* USE_PAM */
|
||||
"hr",
|
||||
#endif
|
||||
long_options, &option_index)) != -1) {
|
||||
long_options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case 'h':
|
||||
usage (EXIT_SUCCESS);
|
||||
|
5
src/su.c
5
src/su.c
@ -735,7 +735,6 @@ static void save_caller_context (char **argv)
|
||||
*/
|
||||
static void process_flags (int argc, char **argv)
|
||||
{
|
||||
int option_index = 0;
|
||||
int c;
|
||||
static struct option long_options[] = {
|
||||
{"command", required_argument, NULL, 'c'},
|
||||
@ -746,8 +745,8 @@ static void process_flags (int argc, char **argv)
|
||||
{NULL, 0, NULL, '\0'}
|
||||
};
|
||||
|
||||
while ((c = getopt_long (argc, argv, "c:hlmps:", long_options,
|
||||
&option_index)) != -1) {
|
||||
while ((c = getopt_long (argc, argv, "c:hlmps:",
|
||||
long_options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case 'c':
|
||||
command = optarg;
|
||||
|
Loading…
Reference in New Issue
Block a user