X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=parse.c;h=3e94c7d577746e251845245ce4fad018b76829ef;hb=2b9f9141f2b56ec74f27ef8a82d75859dc3af04c;hp=745056bdc8186e54743d2fb688df926084c91853;hpb=0f38bbef532ef9da0d43382dca58a20e57c63dc1;p=fio.git diff --git a/parse.c b/parse.c index 745056bd..3e94c7d5 100644 --- a/parse.c +++ b/parse.c @@ -1061,6 +1061,19 @@ int string_distance(const char *s1, const char *s2) return i; } +/* + * Make a guess of whether the distance from 's1' is significant enough + * to warrant printing the guess. We set this to a 1/2 match. + */ +int string_distance_ok(const char *opt, int distance) +{ + size_t len; + + len = strlen(opt); + len = (len + 1) / 2; + return distance <= len; +} + static struct fio_option *find_child(struct fio_option *options, struct fio_option *o) {