From 9af283654a6e93ee1e0950ac87311a59215a027f Mon Sep 17 00:00:00 2001 From: kpfleming Date: Mon, 26 Nov 2007 17:21:37 +0000 Subject: Merged revisions 89586 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89586 | kpfleming | 2007-11-26 11:20:36 -0600 (Mon, 26 Nov 2007) | 2 lines 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/trunk@89588 f38db490-d61c-443f-a65b-d21fe96a405b --- main/app.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main/app.c') diff --git a/main/app.c b/main/app.c index fd286fa17..4fda65ce0 100644 --- a/main/app.c +++ b/main/app.c @@ -1608,7 +1608,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 */ @@ -1625,6 +1624,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; -- cgit v1.2.3