summaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-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);
}