1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Merge pull request #652 from LemonBoy/trailing-arg

Properly check the command arguments in tail place.
This commit is contained in:
ailin-nemui 2017-03-04 21:36:01 +01:00 committed by Ailin Nemui
parent 0ada284a25
commit c111e09133

View File

@ -567,13 +567,14 @@ static int get_cmd_options(char **data, int ignore_unknown,
option = NULL; pos = -1;
for (;;) {
if (**data == '-') {
if (**data == '\0' || **data == '-') {
if (option != NULL && *optlist[pos] == '+') {
/* required argument missing! */
*data = optlist[pos] + 1;
return CMDERR_OPTION_ARG_MISSING;
}
}
if (**data == '-') {
(*data)++;
if (**data == '-' && (*data)[1] == ' ') {
/* -- option means end of options even