goptions: ensure that FIO_OPT_STR_VAL doesn't exceed max multiplier
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index dd4e4dd06208233f0303193119f10758162682e5..545c3de56bd9600b3e228f3c392125faf627102c 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -833,9 +833,8 @@ int parse_option(char *opt, const char *input,
                return 1;
        }
 
-       if (!handle_option(*o, post, data)) {
+       if (!handle_option(*o, post, data))
                return 0;
-       }
 
        log_err("fio: failed parsing %s\n", input);
        return 1;
@@ -1049,7 +1048,7 @@ void option_init(struct fio_option *o)
        }
        if (!o->category) {
                log_info("Options %s: no category defined. Setting to misc\n", o->name);
-               o->category = FIO_OPT_G_MISC;
+               o->category = FIO_OPT_C_GENERAL;
        }
 }
 
@@ -1063,8 +1062,11 @@ void options_init(struct fio_option *options)
 
        dprint(FD_PARSE, "init options\n");
 
-       for (o = &options[0]; o->name; o++)
+       for (o = &options[0]; o->name; o++) {
                option_init(o);
+               if (o->inverse)
+                       o->inv_opt = find_option(options, o->inverse);
+       }
 }
 
 void options_free(struct fio_option *options, void *data)