diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-26 17:20:36 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-26 17:20:36 +0000 |
commit | 313ac29ab2734cc8a5f431f82539066841bfb092 (patch) | |
tree | 5e31e50470f8a579663b6c9b379b82ac522b74b2 /main/app.c | |
parent | 38e80bc77efcdbae4d4b536f8d7de12c109576fa (diff) |
when parsing application options that take arguments, don't indicate that the option was supplied unless a non-zero-length argument was found for it
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89586 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/app.c')
-rw-r--r-- | main/app.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/app.c b/main/app.c index 5c348dc7f..d64a50373 100644 --- a/main/app.c +++ b/main/app.c @@ -1394,7 +1394,6 @@ int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags s = optstr; while (*s) { curarg = *s++ & 0x7f; /* the array (in app.h) has 128 entries */ - ast_set_flag(flags, options[curarg].flag); argloc = options[curarg].arg_index; if (*s == '(') { /* Has argument */ @@ -1411,6 +1410,8 @@ int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags } else if (argloc) { args[argloc - 1] = NULL; } + if (!argloc || !ast_strlen_zero(args[argloc - 1])) + ast_set_flag(flags, options[curarg].flag); } return res; |