diff --git a/cmd-list-keys.c b/cmd-list-keys.c index 6c0fec67..4f2c9dd3 100644 --- a/cmd-list-keys.c +++ b/cmd-list-keys.c @@ -195,10 +195,6 @@ cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item) } sort_crit.reversed = args_has(args, 'r'); - prefix = cmd_list_keys_get_prefix(args); - single = args_has(args, '1'); - notes_only = args_has(args, 'N'); - if ((tablename = args_get(args, 'T')) != NULL) { table = key_bindings_get_table(tablename, 0); if (table == NULL) { @@ -207,6 +203,10 @@ cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item) } } + prefix = cmd_list_keys_get_prefix(args); + single = args_has(args, '1'); + notes_only = args_has(args, 'N'); + if ((template = args_get(args, 'F')) == NULL) template = LIST_KEYS_TEMPLATE; diff --git a/cmd-parse.y b/cmd-parse.y index 215943b1..542f37d1 100644 --- a/cmd-parse.y +++ b/cmd-parse.y @@ -1604,7 +1604,9 @@ yylex_token_tilde(char **buf, size_t *len) if (*name == '\0') { envent = environ_find(global_environ, "HOME"); - if (envent != NULL && *envent->value != '\0') + if (envent != NULL && + envent->value != NULL && + *envent->value != '\0') home = envent->value; else if ((pw = getpwuid(getuid())) != NULL) home = pw->pw_dir; diff --git a/control.c b/control.c index 35f960d2..0273227f 100644 --- a/control.c +++ b/control.c @@ -1045,6 +1045,9 @@ control_check_subs_timer(__unused int fd, __unused short events, void *data) log_debug("%s: timer fired", __func__); evtimer_add(&cs->subs_timer, &tv); + if (s == NULL) + return; + /* Find which subscription types are present. */ RB_FOREACH(csub, control_subs, &cs->subs) { switch (csub->type) {