An option need not include ->posval[] entries
authorJens Axboe <jens.axboe@oracle.com>
Tue, 13 Mar 2007 07:54:06 +0000 (08:54 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 13 Mar 2007 07:54:06 +0000 (08:54 +0100)
So only fail if we actually looked over some entries.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
parse.c

diff --git a/parse.c b/parse.c
index 79565754b804ff12880071912b4d1305b15f7c08..21fb3c2eeda611fd6ab1b43010ec5c36f868fbc3 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -197,11 +197,11 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
                const struct value_pair *vp;
                int i;
 
                const struct value_pair *vp;
                int i;
 
-               ret = 1;
                for (i = 0; i < PARSE_MAX_VP; i++) {
                        vp = &o->posval[i];
                        if (!vp->ival || vp->ival[0] == '\0')
                                break;
                for (i = 0; i < PARSE_MAX_VP; i++) {
                        vp = &o->posval[i];
                        if (!vp->ival || vp->ival[0] == '\0')
                                break;
+                       ret = 1;
                        if (!strncmp(vp->ival, ptr, strlen(vp->ival))) {
                                ret = 0;
                                if (!o->off1)
                        if (!strncmp(vp->ival, ptr, strlen(vp->ival))) {
                                ret = 0;
                                if (!o->off1)