Properly strip end-of-option blanks
We don't want to fail with
option_foo = 0
when
option_foo=0
works.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/parse.c b/parse.c
index 44c02f6..f838a1f 100644
--- a/parse.c
+++ b/parse.c
@@ -474,6 +474,7 @@
*ret = '\0';
ret = (char *) opt;
(*post)++;
+ strip_blank_end(ret);
o = find_option(options, ret);
} else {
o = find_option(options, opt);
@@ -520,7 +521,7 @@
o = find_option(options, opt);
if (!o) {
- fprintf(stderr, "Bad option %s\n", opt);
+ fprintf(stderr, "Bad option <%s>\n", opt);
return 1;
}
@@ -589,7 +590,7 @@
o = get_option(tmp, options, &post);
if (!o) {
- fprintf(stderr, "Bad option %s\n", tmp);
+ fprintf(stderr, "Bad option <%s>\n", tmp);
free(tmp);
return 1;
}