Hi Jan and Lam developers;
I found a building problem while building lam7.1.1 on
FreeBSD-6.1-Release: lam has a function called strtonum in
share/args/all_opt.c. this function conflicts with strtonum(3), a BSD
extension taken from OpenBSD.
The attached patch builds lam for me again: I just renamed the function,
can you please verify it?
regards,
Pedro.
--- share/args/all_opt.c.orig Wed May 17 17:49:22 2006
+++ share/args/all_opt.c Wed May 17 17:50:07 2006
@@ -33,7 +33,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(const char *str, int *pnum);
+static int istrtonum(const char *str, int *pnum);
static struct ao_opt *findopt(OPT *desc, const char *optstr);
@@ -652,7 +652,7 @@
/*
* If a number, assume '#' option.
*/
- else if (strtonum(++str, &num) == 0) {
+ else if (istrtonum(++str, &num) == 0) {
popt = findopt(aod, "#");
if ((popt == 0) || (mutexchk(popt))) {
@@ -884,7 +884,7 @@
/*
- * strtonum
+ * istrtonum
*
* Function: - convert string to number if possible
* - handles decimal/octal/hexadecimal
@@ -894,7 +894,7 @@
* Returns: - 0 or LAMERROR
*/
static int
-strtonum(const char *str, int *pnum)
+istrtonum(const char *str, int *pnum)
{
char *endstr; /* end of parsed string */
@@ -956,7 +956,7 @@
if (strcmp(string, "--") == 0) break;
- if ((strtonum(string + 1, &num) == 0) &&
+ if ((istrtonum(string + 1, &num) == 0) &&
(findopt(aod, "#") != 0)) break;
if (findopt(aod, string + 1)) break;
@@ -1036,7 +1036,7 @@
for (; nparam > 0; --nparam, ++params, parmbuf += size) {
if (fl_int) {
- if (strtonum(*params, &num)) {
+ if (istrtonum(*params, &num)) {
errno = EUSAGE;
return(LAMERROR);
}
|