From 18af462831ca3f17272ed42e73763861bb6b47d8 Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Thu, 16 Oct 2014 21:59:13 +0200
Subject: [PATCH] Fixed segfault on :autocmd without group (#115).

---
 src/autocmd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/autocmd.c b/src/autocmd.c
index 179c70d..4ac3569 100644
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -163,11 +163,12 @@ gboolean autocmd_add(char *name, gboolean delete)
 
             /* group is found - get the next word */
             word = get_next_word(&parse);
-        } else {
-            /* no group found - use the current one */
-            grp = curgroup;
         }
     }
+    if (!grp) {
+        /* no group found - use the current one */
+        grp = curgroup;
+    }
 
     /* parse event name - if none was matched run it for all events */
     if (word) {
-- 
2.20.1