From: Daniel Carl <danielcarl@gmx.de>
Date: Wed, 12 Mar 2014 22:41:13 +0000 (+0100)
Subject: Fixed segfault of not shortcut default is set.
X-Git-Url: https://git.owens.tech/projects.html/projects.html/git?a=commitdiff_plain;h=d97b2ec07d75a47e4840a8473538ea3b40a7b0fa;p=vimb.git

Fixed segfault of not shortcut default is set.
---

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;
     }