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