summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2010-11-13 15:20:26 +0100
committerSven Verdoolaege <skimo@kotnet.org>2010-11-24 20:25:02 +0100
commit3a69d95d6f92d661d6635fe0ad967f1a2b768a02 (patch)
treea5e5e8bdf1ede2555c604eb9bf8ed17e67fbff42
parent35e8c4c68bd93c327ba7cdb7cc1e7ca95dc21ab6 (diff)
downloadisl-3a69d95d6f92d661d6635fe0ad967f1a2b768a02.tar.gz
isl-3a69d95d6f92d661d6635fe0ad967f1a2b768a02.tar.bz2
isl-3a69d95d6f92d661d6635fe0ad967f1a2b768a02.zip
isl_arg_parse: allow options without long name
-rw-r--r--isl_arg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/isl_arg.c b/isl_arg.c
index c6ffa149..93785839 100644
--- a/isl_arg.c
+++ b/isl_arg.c
@@ -479,6 +479,8 @@ static const char *skip_name(struct isl_arg *decl, const char *arg,
*has_argument = arg[2] != '\0';
return arg + 2;
}
+ if (!decl->long_name)
+ return NULL;
if (strncmp(arg, "--", 2))
return NULL;
@@ -608,6 +610,9 @@ static int parse_bool_option(struct isl_arg *decl, const char *arg,
return 1;
}
+ if (!decl->long_name)
+ return 0;
+
if (strncmp(arg, "--", 2))
return 0;
arg += 2;