From ae2ddba4e74f06b5ec986d1c3387cd14e69f8146 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 10 Mar 2010 12:49:03 +0100 Subject: [PATCH] Fix broken FIO_OPT_STR option Only break out and show help if the option had ->posval entries. Signed-off-by: Jens Axboe --- parse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parse.c b/parse.c index cbe8e35f..fb5d4579 100644 --- a/parse.c +++ b/parse.c @@ -289,7 +289,7 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data, fio_opt_str_fn *fn = o->cb; const struct value_pair *vp; struct value_pair posval[PARSE_MAX_VP]; - int i; + int i, all_skipped = 1; posval_sort(o, posval); @@ -298,6 +298,7 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data, vp = &posval[i]; if (!vp->ival || vp->ival[0] == '\0') continue; + all_skipped = 0; if (!strncmp(vp->ival, ptr, strlen(vp->ival))) { ret = 0; if (o->roff1) { @@ -314,7 +315,7 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data, } } - if (ret) + if (ret && !all_skipped) show_option_values(o); else if (fn) ret = fn(data, ptr); -- 2.25.1