summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2009-07-07 00:16:22 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2009-07-07 00:16:22 +0000
commit2647cdd74706e9736b5e956cbaad4ddf399520d1 (patch)
treea90e3db006468e2f058ebe874684174ae691554b /usr.bin
parentd9b8e4586679a4af8ce0259b276dee9d4b2ba4c0 (diff)
sync to 1.7.21: suboptarg is not portable to Linux;
no functional change on OpenBSD
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/main.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index f56644b88ca..c141acea5cc 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.9 2009/07/06 22:12:38 schwarze Exp $ */
+/* $Id: main.c,v 1.10 2009/07/07 00:16:21 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -539,7 +539,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";
@@ -549,7 +549,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;
@@ -568,9 +569,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);
}
@@ -579,7 +581,7 @@ foptions(int *fflags, char *arg)
static int
woptions(int *wflags, char *arg)
{
- char *v;
+ char *v, *o;
char *toks[5];
toks[0] = "all";
@@ -588,7 +590,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;
@@ -603,9 +606,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);
}