diff options
author | Sven Verdoolaege <skimo@kotnet.org> | 2010-11-12 14:42:46 +0100 |
---|---|---|
committer | Sven Verdoolaege <skimo@kotnet.org> | 2010-11-12 16:10:17 +0100 |
commit | 2897182459dbb129c30723d7c7a92cd0a24da565 (patch) | |
tree | 74f330001987b6767487ddddb01c68ed27b9520f | |
parent | 07edb4c5fec4fdde3b726bf11ac4df85d1a45614 (diff) | |
download | isl-2897182459dbb129c30723d7c7a92cd0a24da565.tar.gz isl-2897182459dbb129c30723d7c7a92cd0a24da565.tar.bz2 isl-2897182459dbb129c30723d7c7a92cd0a24da565.zip |
isl_options_parse: accept prefix before or after "no" on boolean options
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
-rw-r--r-- | isl_arg.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -599,9 +599,22 @@ static int parse_bool_option(struct isl_arg *decl, const char *arg, return 1; } - if (strncmp(arg, "--no-", 5)) + if (strncmp(arg, "--", 2)) + return 0; + arg += 2; + + if (prefix) { + size_t prefix_len = strlen(prefix); + if (strncmp(arg, prefix, prefix_len) == 0 && + arg[prefix_len] == '-') { + arg += prefix_len + 1; + prefix = NULL; + } + } + + if (strncmp(arg, "no-", 3)) return 0; - arg += 5; + arg += 3; if (prefix) { size_t prefix_len = strlen(prefix); |