Eric Blake <[EMAIL PROTECTED]> writes: > Didn't we decide that opti is not reset between getopt_long invocations?... > And you would also have to patch POTFILES.in.
Right you are, on both points. Here's a revised patch for findutils. You might want to adjust the indentation of the 'for' loop after the patch. 2007-08-10 Paul Eggert <[EMAIL PROTECTED]> * locate/locate.c (dolocate): Adjust to API change of xstrtol gnulib module. * po/POTFILES.in: Likewise. Index: locate/locate.c =================================================================== RCS file: /cvsroot/findutils/findutils/locate/locate.c,v retrieving revision 1.89 diff -p -u -b -w -r1.89 locate.c --- locate/locate.c 5 Aug 2007 12:22:14 -0000 1.89 +++ locate/locate.c 10 Aug 2007 18:59:11 -0000 @@ -1566,7 +1566,6 @@ dolocate (int argc, char **argv, int sec { char *dbpath; unsigned long int found = 0uL; - int optc; int ignore_case = 0; int print = 0; int just_count = 0; @@ -1608,7 +1607,13 @@ dolocate (int argc, char **argv, int sec check_existence = ACCEPT_EITHER; - while ((optc = getopt_long (argc, argv, "Abcd:eEil:prsm0SwHPL", longopts, (int *) 0)) != -1) + for (;;) + { + int opti = -1; + int optc = getopt_long (argc, argv, "Abcd:eEil:prsm0SwHPL", longopts, &opti); + if (optc == -1) + break; + switch (optc) { case '0': @@ -1698,7 +1703,7 @@ dolocate (int argc, char **argv, int sec strtol_error err = xstrtoumax(optarg, &end, 10, &limits.limit, NULL); if (LONGINT_OK != err) { - STRTOL_FATAL_ERROR(optarg, _("argument to --limit"), err); + xstrtol_fatal (err, opti, optc, longopts, optarg); } use_limit = 1; } @@ -1715,6 +1720,7 @@ dolocate (int argc, char **argv, int sec usage (stderr); return 1; } + } /* If the user gave the -d option or set LOCATE_PATH, Index: po/POTFILES.in =================================================================== RCS file: /cvsroot/findutils/findutils/po/POTFILES.in,v retrieving revision 1.6 diff -p -u -b -w -r1.6 POTFILES.in --- po/POTFILES.in 23 Jul 2007 02:55:17 -0000 1.6 +++ po/POTFILES.in 10 Aug 2007 18:59:11 -0000 @@ -1,5 +1,5 @@ # List of source files containing translatable strings. -# Copyright (C) 2000 Free Software Foundation, Inc. +# Copyright (C) 2000, 2007 Free Software Foundation, Inc. # Common library files gnulib/lib/argmatch.c @@ -14,7 +14,7 @@ gnulib/lib/quotearg.c gnulib/lib/regcomp.c gnulib/lib/rpmatch.c gnulib/lib/xalloc-die.c -gnulib/lib/xstrtol.h +gnulib/lib/xstrtol-error.c #Package source files find/find.c