mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
generate a warning when an application option that requires an argument is ignored due to lack of an argument
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1410,8 +1410,11 @@ 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);
|
||||
if (argloc && ast_strlen_zero(args[argloc - 1])) {
|
||||
ast_log(LOG_WARNING, "Argument supplied for option '%c' was empty, option ignored.\n", curarg);
|
||||
continue;
|
||||
}
|
||||
ast_set_flag(flags, options[curarg].flag);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
Reference in New Issue
Block a user