It is silly for cmd_list_parse to return an integer error when it could

just return NULL.
This commit is contained in:
nicm
2017-01-15 22:00:56 +00:00
parent 3054846143
commit 52847a9518
11 changed files with 31 additions and 45 deletions

View File

@ -379,12 +379,10 @@ key_bindings_init(void)
u_int i;
struct cmd_list *cmdlist;
char *cause;
int error;
for (i = 0; i < nitems(defaults); i++) {
error = cmd_string_parse(defaults[i], &cmdlist,
"<default-keys>", i, &cause);
if (error != 0)
cmdlist = cmd_string_parse(defaults[i], "<default>", i, &cause);
if (cmdlist == NULL)
fatalx("bad default key");
cmdq_append(NULL, cmdq_get_command(cmdlist, NULL, NULL, 0));
cmd_list_free(cmdlist);