openbsd-ports/devel/lam/patches/patch-share_args_all_opt_c

58 lines
1.7 KiB
Plaintext

$OpenBSD: patch-share_args_all_opt_c,v 1.1 2004/05/09 21:11:16 naddy Exp $
--- share/args/all_opt.c.orig 2004-05-08 18:29:21.000000000 +0200
+++ share/args/all_opt.c 2004-05-08 18:29:52.000000000 +0200
@@ -34,7 +34,7 @@
static int addinst(struct ao_opt *opt, int nparam, char **params);
static int countparam(OPT *aod, struct ao_opt *opt, char **argv);
static int mutexchk(struct ao_opt *opt);
-static int strtonum(char *str, int *pnum);
+static int ao_strtonum(char *str, int *pnum);
static struct ao_opt *findopt(OPT *desc, char *optstr);
@@ -481,7 +481,7 @@ ao_parse(OPT *aod, int *pcmdc, char **cm
/*
* If a number, assume '#' option.
*/
- else if (strtonum(++str, &num) == 0) {
+ else if (ao_strtonum(++str, &num) == 0) {
popt = findopt(aod, "#");
if ((popt == 0) || (mutexchk(popt))) {
@@ -650,7 +650,7 @@ findopt(OPT *desc, char *optstr)
}
/*
- * strtonum
+ * ao_strtonum
*
* Function: - convert string to number if possible
* - handles decimal/octal/hexadecimal
@@ -660,7 +660,7 @@ findopt(OPT *desc, char *optstr)
* Returns: - 0 or LAMERROR
*/
static int
-strtonum(char *str, int *pnum)
+ao_strtonum(char *str, int *pnum)
{
char *endstr; /* end of parsed string */
@@ -720,7 +720,7 @@ countparam(OPT *aod, struct ao_opt *opt,
if (strcmp(string, "--") == 0) break;
- if ((strtonum(string + 1, &num) == 0) &&
+ if ((ao_strtonum(string + 1, &num) == 0) &&
(findopt(aod, "#") != 0)) break;
if (findopt(aod, string + 1)) break;
@@ -799,7 +799,7 @@ addinst(struct ao_opt *opt, int nparam,
for (; nparam > 0; --nparam, ++params, parmbuf += size) {
if (fl_int) {
- if (strtonum(*params, &num)) {
+ if (ao_strtonum(*params, &num)) {
errno = EUSAGE;
return(LAMERROR);
}