summaryrefslogtreecommitdiffstatshomepage
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
commit4ecd5f379a9ede899bebfe6091fd0b1acba5a49c (patch)
tree9632ebc51cca83d35f5ccf43e4f7820aa1eb6b5f
parent3ca6ba676b212f6fa2e93edd074f498e54da8064 (diff)
downloadmandoc-4ecd5f379a9ede899bebfe6091fd0b1acba5a49c.tar.gz
mandoc-4ecd5f379a9ede899bebfe6091fd0b1acba5a49c.tar.zst
mandoc-4ecd5f379a9ede899bebfe6091fd0b1acba5a49c.zip
suboptarg is not portable to Linux (fixed).
-rw-r--r--main.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/main.c b/main.c
index b9120ef2..be4b3b54 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.33 2009/07/04 09:01:55 kristaps Exp $ */
+/* $Id: main.c,v 1.34 2009/07/04 11:10:36 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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);
}