isl_arg_parse: allow options without long name
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 13 Nov 2010 14:20:26 +0000 (15:20 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 24 Nov 2010 19:25:02 +0000 (20:25 +0100)
isl_arg.c

index c6ffa14..9378583 100644 (file)
--- 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;