diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-09-14 17:20:24 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-09-14 17:20:24 +0000 |
commit | 4e7c01765f7b3cbfa97280853bd8fbcd3ce7f558 (patch) | |
tree | 7e16f0faa3229698131af708e53849666c6da15f | |
parent | 49ade5ed71ab26193b9d0fd56abb7f1c34d66ada (diff) |
use a better name for structure element (when using named initializers)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rwxr-xr-x | app.c | 12 | ||||
-rwxr-xr-x | include/asterisk/app.h | 2 |
2 files changed, 8 insertions, 6 deletions
@@ -1506,27 +1506,30 @@ int ast_parseoptions(const struct ast_option *options, struct ast_flags *flags, int argloc; char *arg; int res = 0; + flags->flags = 0; + if (!optstr) return 0; + s = optstr; - while(*s) { + while (*s) { curarg = *s & 0x7f; flags->flags |= options[curarg].flag; - argloc = options[curarg].argoption; + argloc = options[curarg].arg_index; s++; if (*s == '(') { /* Has argument */ s++; arg = s; - while(*s && (*s != ')')) s++; + while (*s && (*s != ')')) s++; if (*s) { if (argloc) args[argloc - 1] = arg; *s = '\0'; s++; } else { - ast_log(LOG_WARNING, "Missing closing parenthesis for argument '%c'\n", curarg); + ast_log(LOG_WARNING, "Missing closing parenthesis for argument '%c' in string '%s'\n", curarg, arg); res = -1; } } else if (argloc) @@ -1534,4 +1537,3 @@ int ast_parseoptions(const struct ast_option *options, struct ast_flags *flags, } return res; } - diff --git a/include/asterisk/app.h b/include/asterisk/app.h index 6f0f0d955..706871f8d 100755 --- a/include/asterisk/app.h +++ b/include/asterisk/app.h @@ -75,7 +75,7 @@ struct ast_ivr_menu { struct ast_option { unsigned int flag; - int argoption; + int arg_index; }; extern int ast_parseoptions(const struct ast_option *options, struct ast_flags *flags, char **args, char *optstr); |