mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 00:04:53 +00:00
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
This commit is contained in:
8
app.c
8
app.c
@@ -1506,14 +1506,17 @@ int ast_parseoptions(const struct ast_option *options, struct ast_flags *flags,
|
|||||||
int argloc;
|
int argloc;
|
||||||
char *arg;
|
char *arg;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
flags->flags = 0;
|
flags->flags = 0;
|
||||||
|
|
||||||
if (!optstr)
|
if (!optstr)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
s = optstr;
|
s = optstr;
|
||||||
while (*s) {
|
while (*s) {
|
||||||
curarg = *s & 0x7f;
|
curarg = *s & 0x7f;
|
||||||
flags->flags |= options[curarg].flag;
|
flags->flags |= options[curarg].flag;
|
||||||
argloc = options[curarg].argoption;
|
argloc = options[curarg].arg_index;
|
||||||
s++;
|
s++;
|
||||||
if (*s == '(') {
|
if (*s == '(') {
|
||||||
/* Has argument */
|
/* Has argument */
|
||||||
@@ -1526,7 +1529,7 @@ int ast_parseoptions(const struct ast_option *options, struct ast_flags *flags,
|
|||||||
*s = '\0';
|
*s = '\0';
|
||||||
s++;
|
s++;
|
||||||
} else {
|
} 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;
|
res = -1;
|
||||||
}
|
}
|
||||||
} else if (argloc)
|
} else if (argloc)
|
||||||
@@ -1534,4 +1537,3 @@ int ast_parseoptions(const struct ast_option *options, struct ast_flags *flags,
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -75,7 +75,7 @@ struct ast_ivr_menu {
|
|||||||
|
|
||||||
struct ast_option {
|
struct ast_option {
|
||||||
unsigned int flag;
|
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);
|
extern int ast_parseoptions(const struct ast_option *options, struct ast_flags *flags, char **args, char *optstr);
|
||||||
|
Reference in New Issue
Block a user