]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
when parsing application options that take arguments, don't indicate that the option...
authorKevin P. Fleming <kpfleming@digium.com>
Mon, 26 Nov 2007 17:20:36 +0000 (17:20 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Mon, 26 Nov 2007 17:20:36 +0000 (17:20 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89586 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/app.c

index 5c348dc7f83c8cb1abe34122d43a0f8d5c6f6af9..d64a503738747e8d08ca239b60ccf3cc2162887a 100644 (file)
@@ -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;