Only clear string pointer in parser for sub-value options
authorJens Axboe <jaxboe@fusionio.com>
Wed, 31 Aug 2011 22:45:03 +0000 (16:45 -0600)
committerJens Axboe <jaxboe@fusionio.com>
Wed, 31 Aug 2011 22:45:03 +0000 (16:45 -0600)
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
parse.c

diff --git a/parse.c b/parse.c
index 25de29e2a84eb51605562b355869d3006bdec632..2dee446d7a8a2ad0614e37c4a5bd09796f5e296d 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -489,8 +489,10 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
 
                posval_sort(o, posval);
 
-               if (!o->posval[0].ival)
+               if (!o->posval[0].ival) {
+                       vp = NULL;
                        goto match;
+               }
 
                ret = 1;
                for (i = 0; i < PARSE_MAX_VP; i++) {
@@ -514,7 +516,7 @@ match:
                                if (rest) {
                                        *rest = '\0';
                                        ptr = rest + 1;
-                               } else
+                               } else if (vp && vp->cb)
                                        ptr = NULL;
                                break;
                        }