Index: app.c =================================================================== RCS file: /usr/cvsroot/asterisk/app.c,v retrieving revision 1.82 diff -u -r1.82 app.c --- app.c 3 Nov 2005 21:19:10 -0000 1.82 +++ app.c 7 Nov 2005 02:30:31 -0000 @@ -1543,18 +1543,18 @@ argloc = options[curarg].arg_index; if (*s == '(') { /* Has argument */ - arg = s; + arg = ++s; while (*++s && (*s != ')')); if (*s) { - if (argloc) - args[argloc - 1] = arg; *s++ = '\0'; + if (argloc >= 0) + args[argloc] = arg; } else { ast_log(LOG_WARNING, "Missing closing parenthesis for argument '%c' in string '%s'\n", curarg, arg); res = -1; } - } else if (argloc) { - args[argloc - 1] = NULL; + } else if (argloc >= 0) { + args[argloc] = NULL; } } Index: include/asterisk/app.h =================================================================== RCS file: /usr/cvsroot/asterisk/include/asterisk/app.h,v retrieving revision 1.44 diff -u -r1.44 app.h --- include/asterisk/app.h 6 Nov 2005 15:09:47 -0000 1.44 +++ include/asterisk/app.h 7 Nov 2005 02:30:38 -0000 @@ -251,7 +251,7 @@ unsigned int flag; /*! \brief The index of the entry in the arguments array that should be used for this option's argument. */ - unsigned int arg_index; + int arg_index; }; /*! @@ -312,7 +312,7 @@ \sa AST_APP_OPTIONS, ast_app_parse_options */ #define AST_APP_OPTION(option, flagno) \ - [option] = { .flag = flagno } + [option] = { .flag = flagno, .arg_index = -1 } /*! \brief Declares an application option that accepts an argument.