Fixed segfault of not shortcut default is set.
authorDaniel Carl <danielcarl@gmx.de>
Wed, 12 Mar 2014 22:41:13 +0000 (23:41 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Wed, 12 Mar 2014 22:41:13 +0000 (23:41 +0100)
src/ex.c
src/shortcut.c

index 80df73a..e4c8306 100644 (file)
--- 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:
index edca08d..1d746e9 100644 (file)
@@ -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;
     }