From d97b2ec07d75a47e4840a8473538ea3b40a7b0fa Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Wed, 12 Mar 2014 23:41:13 +0100 Subject: [PATCH] Fixed segfault of not shortcut default is set. --- src/ex.c | 2 +- src/shortcut.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ex.c b/src/ex.c index 80df73a..e4c8306 100644 --- a/src/ex.c +++ b/src/ex.c @@ -879,7 +879,7 @@ static gboolean ex_shortcut(const ExArg *arg) { char *p; - /* TODO allow to set shortcust with set command like ':set + /* TODO allow to set shortcuts with set command like ':set * shortcut[name]=http://donain.tld/?q=$0' */ switch (arg->code) { case EX_SCA: diff --git a/src/shortcut.c b/src/shortcut.c index edca08d..1d746e9 100644 --- a/src/shortcut.c +++ b/src/shortcut.c @@ -145,7 +145,7 @@ static const char *shortcut_lookup(const char *string, const char **query) } } - if (!uri && (uri = g_hash_table_lookup(shortcuts, default_key))) { + if (!uri && default_key && (uri = g_hash_table_lookup(shortcuts, default_key))) { *query = string; } -- 2.20.1