diff options
Diffstat (limited to 'locale/programs')
-rw-r--r-- | locale/programs/locale.c | 10 | ||||
-rw-r--r-- | locale/programs/localedef.c | 7 |
2 files changed, 10 insertions, 7 deletions
diff --git a/locale/programs/locale.c b/locale/programs/locale.c index e2157311c1..7b0aaaa60f 100644 --- a/locale/programs/locale.c +++ b/locale/programs/locale.c @@ -166,6 +166,8 @@ static void show_info (const char *name); int main (int argc, char *argv[]) { + int remaining; + /* Set initial values for global variables. */ show_category_name = 0; show_keyword_name = 0; @@ -179,7 +181,7 @@ main (int argc, char *argv[]) textdomain (PACKAGE); /* Parse and process arguments. */ - argp_parse (&argp, argc, argv, 0, 0, NULL); + argp_parse (&argp, argc, argv, 0, &remaining, NULL); /* `-a' requests the names of all available locales. */ if (do_all != 0) @@ -203,15 +205,15 @@ main (int argc, char *argv[]) /* If no real argument is given we have to print the contents of the current locale definition variables. These are LANG and the LC_*. */ - if (optind == argc && show_keyword_name == 0 && show_category_name == 0) + if (remaining == argc && show_keyword_name == 0 && show_category_name == 0) { show_locale_vars (); exit (EXIT_SUCCESS); } /* Process all given names. */ - while (optind < argc) - show_info (argv[optind++]); + while (remaining < argc) + show_info (argv[remaining++]); exit (EXIT_SUCCESS); } diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c index 656377f9df..e8f0d3bc54 100644 --- a/locale/programs/localedef.c +++ b/locale/programs/localedef.c @@ -148,6 +148,7 @@ main (int argc, char *argv[]) struct charset_t *charset; struct localedef_t *localedef; struct copy_def_list_t *act_add_locdef; + int remaining; /* Set initial values for global variables. */ copy_list = NULL; @@ -163,7 +164,7 @@ main (int argc, char *argv[]) textdomain (_libc_intl_domainname); /* Parse and process arguments. */ - argp_parse (&argp, argc, argv, 0, 0, NULL); + argp_parse (&argp, argc, argv, 0, &remaining, NULL); /* XXX POSIX is violated since for unknown option a exit value > 3 must be used. */ @@ -172,7 +173,7 @@ main (int argc, char *argv[]) character map. */ verbose |= posix_conformance; - if (argc - optind != 1) + if (argc - remaining != 1) { /* We need exactly one non-option parameter. */ argp_help (&argp, stdout, ARGP_HELP_SEE, @@ -185,7 +186,7 @@ main (int argc, char *argv[]) /* The parameter describes the output path of the constructed files. If the described files cannot be written return a NULL pointer. */ - output_path = construct_output_path (argv[optind]); + output_path = construct_output_path (argv[remaining]); cannot_write_why = errno; /* Now that the parameters are processed we have to reset the local |