X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fargmatch.c;h=c0708bfbbd992c8cde971bd27c4f159c8d813cec;hb=809464b39048da6beb7fa2c216ca8667f6799f67;hp=f3f1a50d229c7b6472d11c8a5a19c43e9cf14527;hpb=d87c39464604e74f580c7fae835be31a4c125c36;p=gnulib.git diff --git a/lib/argmatch.c b/lib/argmatch.c index f3f1a50d2..c0708bfbb 100644 --- a/lib/argmatch.c +++ b/lib/argmatch.c @@ -12,14 +12,20 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Written by David MacKenzie */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + #include #ifdef STDC_HEADERS -#include +# include #endif extern char *program_name; @@ -31,16 +37,16 @@ extern char *program_name; int argmatch (arg, optlist) - char *arg; - char **optlist; + const char *arg; + const char *const *optlist; { int i; /* Temporary index in OPTLIST. */ - int arglen; /* Length of ARG. */ + size_t arglen; /* Length of ARG. */ int matchind = -1; /* Index of first nonexact match. */ int ambiguous = 0; /* If nonzero, multiple nonexact match(es). */ - + arglen = strlen (arg); - + /* Test all elements for either exact match or abbreviated matches. */ for (i = 0; optlist[i]; i++) { @@ -70,8 +76,8 @@ argmatch (arg, optlist) void invalid_arg (kind, value, problem) - char *kind; - char *value; + const char *kind; + const char *value; int problem; { fprintf (stderr, "%s: ", program_name);