From: Daniel Carl Date: Thu, 16 Oct 2014 19:59:13 +0000 (+0200) Subject: Fixed segfault on :autocmd without group (#115). X-Git-Url: https://git.owens.tech/assets/static/git.owens.tech/assets/static/git.owens.tech/git?a=commitdiff_plain;h=18af462831ca3f17272ed42e73763861bb6b47d8;p=vimb.git Fixed segfault on :autocmd without group (#115). --- 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) {