Merge branch 'obsd-master' into master

This commit is contained in:
Thomas Adam 2021-09-10 02:01:12 +01:00
commit 31a6e5eff4
2 changed files with 5 additions and 1 deletions

View File

@ -153,6 +153,10 @@ args_parse(const struct args_parse *parse, struct args_value *values,
flag = *string++; flag = *string++;
if (flag == '\0') if (flag == '\0')
break; break;
if (flag == '?') {
args_free(args);
return (NULL);
}
if (!isalnum(flag)) { if (!isalnum(flag)) {
xasprintf(cause, "invalid flag -%c", flag); xasprintf(cause, "invalid flag -%c", flag);
args_free(args); args_free(args);

2
cmd.c
View File

@ -501,7 +501,7 @@ cmd_parse(struct args_value *values, u_int count, const char *file, u_int line,
const struct cmd_entry *entry; const struct cmd_entry *entry;
struct cmd *cmd; struct cmd *cmd;
struct args *args; struct args *args;
char *error; char *error = NULL;
if (count == 0 || values[0].type != ARGS_STRING) { if (count == 0 || values[0].type != ARGS_STRING) {
xasprintf(cause, "no command"); xasprintf(cause, "no command");