[PATCH] parse.c: Make FIO_OPT_STR explicitly one value
authorJoel Becker <joel.becker@oracle.com>
Thu, 1 Mar 2007 07:22:42 +0000 (08:22 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 1 Mar 2007 07:22:42 +0000 (08:22 +0100)
The original change had __handle_option() check !first to avoid
parsing an FIO_OPT_STR a second time.  However, the caller handle_option()
has a more explicit check.  Excluding FIO_OPT_STR there is much cleaner.

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

diff --git a/parse.c b/parse.c
index 11d745f15649ddd40e2aab2baca52582802ab2b3..d13a60331db7629b2cc3892fa357edd031d35b4a 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -197,9 +197,6 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
                const struct value_pair *vp;
                int i;
 
-               if (!first)
-                       break;
-
                ret = 1;
                for (i = 0; i < PARSE_MAX_VP; i++) {
                        vp = &o->posval[i];
@@ -366,7 +363,9 @@ static int handle_option(struct fio_option *o, const char *ptr, void *data)
         * Do this before parsing the first round, to check if we should
         * copy set 1 options to set 2.
         */
-       if (ptr && (o->type != FIO_OPT_STR_STORE)) {
+       if (ptr &&
+           (o->type != FIO_OPT_STR_STORE) &&
+           (o->type != FIO_OPT_STR)) {
                ptr2 = strchr(ptr, ',');
                if (!ptr2)
                        ptr2 = strchr(ptr, ':');