X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=parse.c;h=879a3aa3c5b190bf63b37dd4b7f90f2be2fd5f83;hp=ffe435a44f2b86a9e9463b2933431dcb1ddc46f1;hb=e6203e9e73039537d41810e91e3dfe6abeb919d9;hpb=ef9aff52b10c71a4cb2b3649deaea270fa3944a0 diff --git a/parse.c b/parse.c index ffe435a4..879a3aa3 100644 --- a/parse.c +++ b/parse.c @@ -188,7 +188,7 @@ static int check_int(const char *p, int *val) { if (!strlen(p)) return 1; - if (strstr(p, "0x")) { + if (strstr(p, "0x") || strstr(p, "0X")) { if (sscanf(p, "%x", val) == 1) return 0; } else { @@ -566,19 +566,15 @@ static struct fio_option *find_child(struct fio_option *options, { struct fio_option *__o; - for (__o = &options[0]; __o->name; __o++) { - if (__o->parent && !strcmp(__o->parent, o->name) - && !__o->parent_seen) { - __o->parent_seen = 1; + for (__o = options + 1; __o->name; __o++) + if (__o->parent && !strcmp(__o->parent, o->name)) return __o; - } - } return NULL; } -static void print_option(struct fio_option *options, struct fio_option *o, - struct fio_option *org, int level) +static void print_option(struct fio_option *o, struct fio_option *org, + int level) { char name[256], *p; @@ -594,7 +590,7 @@ static void print_option(struct fio_option *options, struct fio_option *o, sprintf(p, "%s", o->name); printf("%-24s: %s\n", name, o->help); - print_option(options, find_child(options, org), org, level + 1); + print_option(find_child(o, org), org, level + 1); } int show_cmd_help(struct fio_option *options, const char *name) @@ -633,7 +629,7 @@ int show_cmd_help(struct fio_option *options, const char *name) printf("%24s: %s\n", o->name, o->help); if (show_all) { if (!o->parent) - print_option(options, o, NULL, 0); + print_option(o, NULL, 0); continue; } }