From: Sven Verdoolaege Date: Sat, 13 Nov 2010 14:20:26 +0000 (+0100) Subject: isl_arg_parse: allow options without long name X-Git-Tag: isl-0.05~46 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a69d95d6f92d661d6635fe0ad967f1a2b768a02;p=platform%2Fupstream%2Fisl.git isl_arg_parse: allow options without long name --- diff --git a/isl_arg.c b/isl_arg.c index c6ffa14..9378583 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;