summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-07-04 11:10:36 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-07-04 11:10:36 +0000
commit27b7ab355bc660471df40eb7d5f86178f961855b (patch)
treecb8ec70350b10d6289ae2ce0040d2971851b9619
parent590b4eba529d05829fa3af50e4437f49cdee6bfa (diff)
downloadmandoc-27b7ab355bc660471df40eb7d5f86178f961855b.tar.gz
suboptarg is not portable to Linux (fixed).
-rw-r--r--main.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/main.c b/main.c
index 4be1965d..7dafb720 100644
--- a/main.c
+++ b/main.c
@@ -554,7 +554,7 @@ toptions(enum outt *tflags, char *arg)
static int
foptions(int *fflags, char *arg)
{
- char *v;
+ char *v, *o;
char *toks[6];
toks[0] = "ign-scope";
@@ -564,7 +564,8 @@ foptions(int *fflags, char *arg)
toks[4] = "strict";
toks[5] = NULL;
- while (*arg)
+ while (*arg) {
+ o = arg;
switch (getsubopt(&arg, toks, &v)) {
case (0):
*fflags |= IGN_SCOPE;
@@ -583,9 +584,10 @@ foptions(int *fflags, char *arg)
NO_IGN_MACRO | NO_IGN_CHARS;
break;
default:
- warnx("bad argument: -f%s", suboptarg);
+ warnx("bad argument: -f%s", o);
return(0);
}
+ }
return(1);
}
@@ -594,7 +596,7 @@ foptions(int *fflags, char *arg)
static int
woptions(int *wflags, char *arg)
{
- char *v;
+ char *v, *o;
char *toks[5];
toks[0] = "all";
@@ -603,7 +605,8 @@ woptions(int *wflags, char *arg)
toks[3] = "error";
toks[4] = NULL;
- while (*arg)
+ while (*arg) {
+ o = arg;
switch (getsubopt(&arg, toks, &v)) {
case (0):
*wflags |= WARN_WALL;
@@ -618,9 +621,10 @@ woptions(int *wflags, char *arg)
*wflags |= WARN_WERR;
break;
default:
- warnx("bad argument: -W%s", suboptarg);
+ warnx("bad argument: -W%s", o);
return(0);
}
+ }
return(1);
}